General information
Category:
COM/DCOM and OLE Automation
Title:
VF55.0, Word97 and VBA
Hi,
With Word v6 and Basic, the macro recorder allows for the creation of a macro to perform operations on macros, like deleting a macro etc.
This makes it possible to automate updating of a VFP program that relies upon Word macros for particular functions.
This seems not to be possible in Word97 with VBA. Does anybody know how or if it is possible to perform similar operations in Word97/VBA?
When making repeated calls from VFP to Word97, creating a new doc file at each call, for some reason a file named OFFITMES.LOG in the Windows directory grows with each call. Snooping the file shows that it contains the names of the documets created etc. When it becomes too large, opening or closing of Word becomes very slow.
I can fix this by deleting the log file, but would prefer that the file didn't bevave in this manner at all.
Here is the code I use:
oWord = CREATEOBJECT("Word.Application")
oWord.Run("Mymacro")
* mymacro creates a file by MailMerge, then save and close.
oEdit = CREATEOBJECT(("Word.Basic")
oEdit.Fileopen(filename)
oEdit.AppMaximize
I have found it necessary to create the second object in order to be able to edit the file created by the macro, as I haven't been able to get Word up and visble on the screen by opening the file with oWord.
Hope for some help with this
Rolf
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only