我正在为MS Word使用VBA。我创建了一个MACROFILE(DOCM)创建使用documents.add
....word vba:documents.add:将这个新文档放在顶部
我想从我的宏的文档切换到我的新创建的文档在屏幕上了一个新词 - 文档:
Sub test()
Dim MacroDocument As Document
Set MacroDocument = ActiveDocument
Dim newDocument As Document
Set newDocument = Documents.Add
'try to show my macroDocument on the windows screen,
MacroDocument.Select
stop
' now to the new document
newDocument.Select
End Sub
为什么它不工作?
任何想法?
欢迎来到Stack Overflow!你能详细说明你的代码“不起作用”吗?你在期待什么,究竟发生了什么?如果您遇到异常/错误,请发布其发生的行和异常/错误的详细信息。请[编辑]这些细节或我们可能无法提供帮助。 –