Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Auto-Refresh INCLUDEPICTURE Field in Mail Merge Document
I've developed a mail merge document that uses the INCLUDEPICTURE field with
an IF command to display a different logo depending on what company is represented by the mail merge data. The mail merge works fine, except that the user has to double-click on the header section to open it for editing, CTRL+A to select all objects, then F9 to force refresh the object. This tells Microsoft to go look for the graphic with the path specified. When the user does this, the graphic refreshes and displays the correct graphic with no problems. So the path is correct and the include function works. The problem is that I don't want to force (or rely on) the user to manually know how and to complete the task manually. I want the header to automatically refresh and display the image when the template loads and before the mail merge is finished and completed. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Auto-Refresh INCLUDEPICTURE Field in Mail Merge Document
That's how it works! You *may* get more consistent results if you use the
following syntax { INCLUDEPICTURE "D:\\My Documents\\My Pictures\\{ IF { Mergefield Name } = "Condition" "Signature1.tif" "Signature2.tif" }" } and update the field before running the merge to a new document -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Bnpositive wrote: I've developed a mail merge document that uses the INCLUDEPICTURE field with an IF command to display a different logo depending on what company is represented by the mail merge data. The mail merge works fine, except that the user has to double-click on the header section to open it for editing, CTRL+A to select all objects, then F9 to force refresh the object. This tells Microsoft to go look for the graphic with the path specified. When the user does this, the graphic refreshes and displays the correct graphic with no problems. So the path is correct and the include function works. The problem is that I don't want to force (or rely on) the user to manually know how and to complete the task manually. I want the header to automatically refresh and display the image when the template loads and before the mail merge is finished and completed. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Auto-Refresh INCLUDEPICTURE Field in Mail Merge Document
So there's no way to force the header to auto-refresh itself somehow in a
Macro or VB? Here's my existing syntax if you want to review it. {INCLUDEPICTURE "\\\\ss-vpt\\Viewpoint\\Reports\\SSC\\Graphics\\Logo-Co{MERGEFIELD "JCCo" }{IF {MERGEFIELD "JCCo" } = 98 {MERGEFIELD "Project"}}.JPG" \d} "Graham Mayor" wrote: That's how it works! You *may* get more consistent results if you use the following syntax { INCLUDEPICTURE "D:\\My Documents\\My Pictures\\{ IF { Mergefield Name } = "Condition" "Signature1.tif" "Signature2.tif" }" } and update the field before running the merge to a new document -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Bnpositive wrote: I've developed a mail merge document that uses the INCLUDEPICTURE field with an IF command to display a different logo depending on what company is represented by the mail merge data. The mail merge works fine, except that the user has to double-click on the header section to open it for editing, CTRL+A to select all objects, then F9 to force refresh the object. This tells Microsoft to go look for the graphic with the path specified. When the user does this, the graphic refreshes and displays the correct graphic with no problems. So the path is correct and the include function works. The problem is that I don't want to force (or rely on) the user to manually know how and to complete the task manually. I want the header to automatically refresh and display the image when the template loads and before the mail merge is finished and completed. |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Auto-Refresh INCLUDEPICTURE Field in Mail Merge Document
If you update the includetext field(s) before you run the merge then the
merged document should show the correct images. You can use the update code at http://www.gmayor.com/installing_macro.htm to force an update. You could intercept the merge to a new document command and add in the code to update the fields before merging to a new document e.g. Sub MailMergeToDoc() Dim oStory As Range For Each oStory In ActiveDocument.StoryRanges oStory.Fields.Update If oStory.StoryType wdMainTextStory Then While Not (oStory.NextStoryRange Is Nothing) Set oStory = oStory.NextStoryRange oStory.Fields.Update Wend End If Next oStory Set oStory = Nothing WordBasic.MailMergeToDoc End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Bnpositive wrote: So there's no way to force the header to auto-refresh itself somehow in a Macro or VB? Here's my existing syntax if you want to review it. {INCLUDEPICTURE "\\\\ss-vpt\\Viewpoint\\Reports\\SSC\\Graphics\\Logo-Co{MERGEFIELD "JCCo" }{IF {MERGEFIELD "JCCo" } = 98 {MERGEFIELD "Project"}}.JPG" \d} "Graham Mayor" wrote: That's how it works! You *may* get more consistent results if you use the following syntax { INCLUDEPICTURE "D:\\My Documents\\My Pictures\\{ IF { Mergefield Name } = "Condition" "Signature1.tif" "Signature2.tif" }" } and update the field before running the merge to a new document -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Bnpositive wrote: I've developed a mail merge document that uses the INCLUDEPICTURE field with an IF command to display a different logo depending on what company is represented by the mail merge data. The mail merge works fine, except that the user has to double-click on the header section to open it for editing, CTRL+A to select all objects, then F9 to force refresh the object. This tells Microsoft to go look for the graphic with the path specified. When the user does this, the graphic refreshes and displays the correct graphic with no problems. So the path is correct and the include function works. The problem is that I don't want to force (or rely on) the user to manually know how and to complete the task manually. I want the header to automatically refresh and display the image when the template loads and before the mail merge is finished and completed. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
mail merge refresh data | Mailmerge | |||
During a mail merge, how do I {IncludePicture} while in an {IF..} | Mailmerge | |||
Word 2003 INCLUDEPICTURE with Merge field inconsistant. | Mailmerge | |||
Word 2003 INCLUDEPICTURE with Merge field inconsistant | Mailmerge | |||
Refresh fields by code - specifically {INCLUDEPICTURE} | Mailmerge |