Hi Marty,
As this discussion has already covered, there is no mechanism for passing any
arbitrary string parameter into Word through its command line. However, there
are several other ways to get the information from one place to another.
- If the number of bookmarks in the document is limited and known, you could
write a separate macro for each bookmark, each one containing just a Select
statement for that bookmark and a call to your other code (which will have to be
moved from Document_Open); then use the /m switch on Word's command line to
execute the proper macro. Be aware, though, that this is likely to be a
maintenance nightmare.
- In your app, store the name of the bookmark in a registry entry. Then the Word
Document_Open macro can use the System.PrivateProfileString property to retrieve
the name and select the bookmark.
- Similar to the preceding one, store the bookmark name in a text file in a
known location. The macro can read the text file and then delete it.
There are probably some other possibilities, but these are the simplest.
--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.