Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Name a Word doc without saving?
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01395715
Message ID:
01395736
Views:
74
>I use word to create temporary documents based upon templates. They have data merged, are printed, and are then closed without saving. I'd like to be able to refer to them during the automation process as something other than Document n. Is there a way to do this?

You may use ActiveDocument or ActiveWindow, and then no name is needed, like:
oWord = CREATEOBJECT("Word.Application")
oWord.documents.add()
with oWord.ActiveDocument
    * do whatever you wish
endwith
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform