Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Macro to run according to a field
I want to do a fillin field in a .dot template. When the user creates a file
based on the template, the fillin activates (the normal behaviour), but I want that according to the answer, execute a macro. If the user fills another text, the field executes another macro. Resuming: Is there a solution to the fields execute a macro, like macrobutton, but activating not by double-click, but changing a value in the field? |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Macro to run according to a field
Hi Anderflash,
It has been a while. Or maybe you are another Anderflash. I haven't done this, but IMO there is only one viable way to get a macro to run during a merge, and that's a. use Word's MailMerge Events b. use the MailMergeBeforeRecordMerge event to guide the processing. As far as I can tell from a simple experiment, if you include a FILLIN field in your Mail Merge Main Document, the user is prompted to enter the text /before / the BeforeRecordMerge event fires. So All your BeforeRecordMerge event code has to sdo is a. get the text from the field (e.g. if you know it is the first field in the Mail Merge Main Document, you could use Doc.Fields(1).Result.Text b. execute your additional macro depending on the content of that text Alternatively you might consider using an ASK field and eusing that VBA code to look at the content of the bookmark named in the ASK, or simply issuing an Inputbox call to get the text and do whatever you want with it. -- Peter Jamieson http://tips.pjmsn.me.uk "Anderflash" wrote in message ... I want to do a fillin field in a .dot template. When the user creates a file based on the template, the fillin activates (the normal behaviour), but I want that according to the answer, execute a macro. If the user fills another text, the field executes another macro. Resuming: Is there a solution to the fields execute a macro, like macrobutton, but activating not by double-click, but changing a value in the field? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MacroButton field doesn't start macro | Microsoft Word Help | |||
Update field and macro security | Microsoft Word Help | |||
MACRO for CHECKBOX FORM FIELD | Microsoft Word Help | |||
create a macro in a merge document field | Mailmerge | |||
RD field macro Jonathon West | Formatting Long Documents |