Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - Microsoft
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft, Visual Basic, Office program, how to get a reference from a Word created by a macro ??

Yu-Kang Tsao
Occasional Contributor

Microsoft, Visual Basic, Office program, how to get a reference from a Word created by a macro ??

Hello hp experts:

Does anyone know how can I get a reference for a Word.Document which is created by a microsoft built-in macro ? so that I can make some modification to that Word once I get a reference to it.

The thing is this:
In Visual Basic,
if you got

'-------------------------------
Dim pt As New PowerPoint.Application
pt.Commandbars.FindControl(Id:=684).Execute
'-------------------------------

It will open a Power Point file and pop out a window that let you choose the options and then it will convert that Power Point file to Word document. That newly created Word document will show as "Document1". but I need to make some modification to that file, so I need to get a reference to that newly created Word document. I try

Dim wordtest As Word.Document
Set wordtest = GetObject( , "Word.Document")

and it does not work. Does any one know how to get a reference for that newly created word document ? Thank you very much for your help.

Sincerely,

Nathan


Thanks.


Totally-Rebuilt by God