-
Word macro
hi,
i want to execute a macro just after a word document is opened. i have tried using the open() method to execute the macro but the macro gets executed before the actual text of the document is displayed. the scenario is as follows: i have a button which opens up a word document. i have some bookmarks in the word document and i need to copy some bookmarks from one place to another. i want this to happen without the user having to manually run the macro. so i tried putting the code into Document.Open() but what happens is as soon as i click on the button the code executes and then the document opens so, i don't get the desired result. is there some way to execute the code after the document is opened?
TIA
urvi
-
Why not just add the code to the existing button ?
-
word macro
hi,
thanks for your reply. i am sorry i should have clarified it before. actually, we have purchased a case management system that allows us to generate letters from the system. unfortunately, the system is not perfect and in order to fill in the gaps in the system i m writing the macro. it is doing exactly what i want it to do and it works perfectly. the only problems is that i don't have the source code (ofcourse) of the purchased system so i have to provide an external interface. i know they have used bookmarks to generate the letters. these bookmarks identify where in the letter the data from database should fit in. i am unable to figure out when these bookmarks get populated. maybe it's somewhere in their code. but because we don't have the source code, i need to make the macro execute independently. i am sorry if this is confusing but i was just curious if there is any way to make a macro execute automatically just after the document is opened.
once again thanks for your reply.