Do you already have a macro that runs when you open the document?
If you don't you will have to define it,
Get into the VBA editor of the document that you want to run then
Double-click on 'ThisDocument' in the project window and change the LEFT drop-down on the code window from 'General' to 'Document' and you will see the OPEN event on the RIGHT drop-down
This will give you a subroutine headed
Private Sub Document_Open()
...... write your code here
End Sub
Then in your batch file you need to append the full path and file name to the call to the executable, and both parts must be in double quotes e.g
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.