Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Anderflash Anderflash is offline
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MacroButton field doesn't start macro D Microsoft Word Help 5 October 6th 06 06:36 AM
Update field and macro security Redapples Microsoft Word Help 2 February 2nd 06 03:41 PM
MACRO for CHECKBOX FORM FIELD cynjor312 Microsoft Word Help 1 November 14th 05 02:52 PM
create a macro in a merge document field wilddove Mailmerge 3 June 15th 05 11:14 AM
RD field macro Jonathon West Patricia Formatting Long Documents 1 May 16th 05 12:38 AM


All times are GMT +1. The time now is 05:19 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"