Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Macro Problem With Merge
Hi
I've written a very simple find and replace macro, however when I merge a document into the template, the macro runs BEFORE the merging (I tested this with a msgbox that shows the macro has run beforehand). I am using "autonew" for the macro at the moment but I really want it to wait until after the merging to run. Any ideas? Thanks. Matthew |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Macro Problem With Merge
Incorporate code in the macro to execute the merge and then have it perform
your find operation on the document that is created by executing the merge. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Matthew W" Matthew wrote in message ... Hi I've written a very simple find and replace macro, however when I merge a document into the template, the macro runs BEFORE the merging (I tested this with a msgbox that shows the macro has run beforehand). I am using "autonew" for the macro at the moment but I really want it to wait until after the merging to run. Any ideas? Thanks. Matthew |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Macro Problem With Merge
Hi
The problem is, is that the merge occurs via an Access VBA application so the Word document is produced from that and then appears on the screen. "Doug Robbins - Word MVP" wrote: Incorporate code in the macro to execute the merge and then have it perform your find operation on the document that is created by executing the merge. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Matthew W" Matthew wrote in message ... Hi I've written a very simple find and replace macro, however when I merge a document into the template, the macro runs BEFORE the merging (I tested this with a msgbox that shows the macro has run beforehand). I am using "autonew" for the macro at the moment but I really want it to wait until after the merging to run. Any ideas? Thanks. Matthew |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Macro Problem With Merge
I don't know where the Autonew would come into it if the merge is being
performed via an Access application, but then I also can't imagine why you would be wanting Find and Replace in these circumstances either. You need to do something like: Set wrdApp = CreateObject("Word.Application") wrdApp.Documents.Open FileName:=strDoc, AddToRecentFiles:=False, Visible:=True wrdApp.Documents.Item(1).Activate With wrdApp.Documents(strDoc).MailMerge .DataSource.FirstRecord = 1 .DataSource.LastRecord = 1 .Destination = wdSendToNewDocument .Execute End With With wrdApp.Documents.Item(1) 'Your find code End With -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Matthew W" wrote in message ... Hi The problem is, is that the merge occurs via an Access VBA application so the Word document is produced from that and then appears on the screen. "Doug Robbins - Word MVP" wrote: Incorporate code in the macro to execute the merge and then have it perform your find operation on the document that is created by executing the merge. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Matthew W" Matthew wrote in message ... Hi I've written a very simple find and replace macro, however when I merge a document into the template, the macro runs BEFORE the merging (I tested this with a msgbox that shows the macro has run beforehand). I am using "autonew" for the macro at the moment but I really want it to wait until after the merging to run. Any ideas? Thanks. Matthew |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Seq Numbering - Macro problem | Microsoft Word Help | |||
macro problem | Microsoft Word Help | |||
Can anyone help on a macro problem that I have | Microsoft Word Help | |||
macro problem | Microsoft Word Help | |||
Macro toolbar problem | Microsoft Word Help |