Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2006

Tip: Looking for answers? Try searching our database.

More header help, please?  IncludePicture with mailmerge

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Earl B - 18 Apr 2006 17:31 GMT
I have worked through my previous issue well enough that I've found the next
problem (don't you HATE that?  "Yay! I'm done!" and whatever you're working
with says "Yeah, right!")

In my mailmerge scenario, I have a picture imported from the database.  
(Write the picture to a file, put the filename in the database, nest the
MERGEFIELD inside the INCLUDEPICTURE)  

When I perform the import with INCLUDEPICTURE in a header, the data is
updated, but the picture doesn't display.  

Inside the INCLUDEPICTURE, the path is correct (well, the filename is
correct - the database contains a full path, but Word truncates to just a
filename because the image file is in the same folder as the document file).

When I copy the INCLUDEPICTURE tag down to the body of the document (out of
the header), the picture shows correctly.

Is there some kind of an "updateimages" like "UpdateFields" that I should
call when the import is done?

Thanks in advance for all advice!

EB
Earl B - 18 Apr 2006 18:38 GMT
Found it - with a little help from before.

After performing the merge, I needed to update each field individually:

Dim objStory As Microsoft.Office.Interop.Word.Range
Dim objField As Microsoft.Office.Interop.Word.Field

For Each objStory In docDestination.StoryRanges
 For Each objField In objStory.Fields
   objField.Update()
 Next

 ' The header/footer ranges can be linked in a way
 ' that is not revealed by the outer For Each
 ' so we have to do the following
 While Not (objStory.NextStoryRange Is Nothing)
   objStory = objStory.NextStoryRange
   For Each objField In objStory.Fields
     objField.Update()
   Next
 End While
Next objStory

objField = Nothing
objStory = Nothing
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.