#16
|
||||
|
||||
Quote:
That said, Word does have a 'MailMergeAfterMerge' class event that could be hooked into to make it automatic, but enabling the event is a fair bit of work to set up and requires the code to be added to the users' templates rather than to the mailmerge main document. For a basic outline, see: http://word.mvps.org/FAQs/MacrosVBA/AppClassEvents.htm
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#17
|
||||
|
||||
Here's a workaround to the linked image issue:
By adding the following macro to your mailmerge main document, clicking on the 'Edit Individual Documents' button will intercept the merge, finishing it and unlinking the pictures. Code:
Sub MailMergeToDoc() Application.ScreenUpdating = False ActiveDocument.MailMerge.Execute ActiveDocument.Fields.Unlink Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#18
|
|||
|
|||
Sorry to remain a pain. Unfortunately it isn't working - let me explain a bit more.
The way the documents are actually created is not from the Word doc. There's an Access database containing records. We create documents by selecting one of various buttons to generate the desired mail merged letter for that specific record. I assume this is preventing your solution from doing anything by bypassing the way it gets triggered. I've also tried the Unlink line in the main VBA code that runs the merge, but no joy (code line emphasised below): Quote:
I've tried a solution suggested elsewhere, of using a separate sub called by the main, but this only delinks the first document, presumably because of something about how it finds ActiveDocument. Quote:
|
#19
|
||||
|
||||
All you needed was:
oApp.ActiveDocument.Fields.Unlink instead of: .Fields.Unlink
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#20
|
|||
|
|||
Quote:
|
#21
|
|||
|
|||
How to name path differently for includepicture field codes
Quote:
can anyone help for me to get this right. much appreciated. |
#22
|
||||
|
||||
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#23
|
|||
|
|||
Dear,
I have tried one of the option mentioned above but with no luck as I still have to refresh the fields (eg Ctrl-A, then F9) to display the Images. The Path of the Image is included in the data field coming from excel. Here is the syntax I follow: {IF {INCLUDEPICTURE {IF TRUE «Picture»} \d} {INCLUDEPICTURE {IF TRUE «Picture»} \d}} Thank you in advance. |
#24
|
||||
|
||||
Kindly read the material in the link referred to in post #22.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#25
|
|||
|
|||
Quote:
I attached a screenshot of my Word document. Is that correct? Last edited by ffmcorrea2; 02-04-2022 at 02:09 PM. Reason: including a screenshot |
#26
|
||||
|
||||
For example: {INCLUDEPICTURE {IF TRUE "C:\fotos\{MERGEFIELD Picture}.jpeg"} \d}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Insert Picture changes colors | rowan.bradley | Drawing and Graphics | 6 | 05-18-2013 05:26 PM |
Macro to insert picture in footer | Sharon | Word | 5 | 01-29-2013 03:12 AM |
insert picture file location | gary1 | Word | 9 | 12-16-2012 04:37 PM |
Macro for Picture Insert | rfhall50 | Word VBA | 2 | 10-25-2010 12:41 PM |
Can I insert a picture into a picture ? | alexcalgary | Drawing and Graphics | 2 | 10-16-2010 03:29 PM |