|
-
Nov 2nd, 2000, 06:38 AM
#1
Thread Starter
Fanatic Member
I want to run microsoft word, open a document and run a macro from the command line. I can run word and open a document no trouble using the following in the run command from my stat menu.
"C:\Program Files\Microsoft Office\Office\WINWORD.EXE" c:\1.doc
but how do I attach a macro command on the end so it will run automatically when word opens. I ONLY want the macro to run when it is opened in this method not when the document is opened in the normal way for editing.
-
Nov 2nd, 2000, 07:33 AM
#2
Addicted Member
Hi davidrobin !!!
look at
http://support.microsoft.com/support...-US&SD=gn&FR=0
there you find the startup commands.
If the macro starts also if you open the word document
at you "normal way" then check out the events
DOCUMENT_OPEN or
AUTO_OPEN
in the vba Editor of this document.
-cu TheOnly
-
Nov 2nd, 2000, 08:21 AM
#3
Addicted Member
We use this all the time. We just take another aproach to this than the previous answer.
We make a template of the document. Then you can use the Document_New event. This will only execute when you open it like your demonstartion and tuns the macro.
When opening the document it looks for the Document_Open event wich is not here. The only problem is saving the file. It wants to make a Doc file of it and with another name then the original. Ofcourse it's possible to bypass this by using the document_close event. By setting making an automated saving routine, all you want is there.
Catch you later,
Jeroen Hoekemeijer
Code:
If 1 = 2 Then MajorError
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|