Reply
 
Thread Tools Display Modes
  #1   Report Post  
john smith
 
Posts: n/a
Default Refresh fields by code - specifically {INCLUDEPICTURE}

I have written a VB app that creates images according to their part# (ie
1.jpg, 2.jpg, 3.jpg ...) and stores all of them in a temp folder.
The app then makes a DataDoc.doc (with boring things like PartName, Material
blah blah) and includes the image-path-name, by using {INCLUDEPICTURE
"C:\\TEMP\\{MERGEFIELD PartID}.jpg"}.

If I stop the formletter document before printing - I see the one picture
repeated for each and every label.
I can select All (ctrl-A) and refresh (F9) - and the correct (differing)
pictures merge. Brilliant!!
How can you refresh INCLUDEPICTURE by using code. I cannot have the user
doing this each time!

PS Have tried: (with no luck)
With oApp.ActiveDocument.MailMerge
.Application.Selection.WholeStory
.Application.Selection.Fields.Update
End With

also tried SENDKEYS - maybe I had F9 wrong.

TIA
Froggie


  #2   Report Post  
Graham Mayor
 
Posts: n/a
Default

The code on my web site in the following link should work:
See http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



john smith wrote:
I have written a VB app that creates images according to their part#
(ie
1.jpg, 2.jpg, 3.jpg ...) and stores all of them in a temp folder.
The app then makes a DataDoc.doc (with boring things like PartName,
Material blah blah) and includes the image-path-name, by using
{INCLUDEPICTURE "C:\\TEMP\\{MERGEFIELD PartID}.jpg"}.

If I stop the formletter document before printing - I see the one
picture repeated for each and every label.
I can select All (ctrl-A) and refresh (F9) - and the correct
(differing) pictures merge. Brilliant!!
How can you refresh INCLUDEPICTURE by using code. I cannot have the
user doing this each time!

PS Have tried: (with no luck)
With oApp.ActiveDocument.MailMerge
.Application.Selection.WholeStory
.Application.Selection.Fields.Update
End With

also tried SENDKEYS - maybe I had F9 wrong.

TIA
Froggie



  #3   Report Post  
john smith
 
Posts: n/a
Default

Graham, many thanks - but it does not update the INCLUDEPICTURE field.
The code is very similar to my original -
With oApp.ActiveDocument.MailMerge
.Application.Selection.WholeStory
.Application.Selection.Fields.Update
End With

following on with your suggestion - is there an AutoPrint automacro?
In my app, Word is opened, populated, merged, printed and closed. Dumb user
remains as dumb user.

I tried to insert it in the Labels.dot template - but the 'action' needs to
take place on_Print, not on open, on close etc.

BTW: does the newsgroup get offended if I include a picture/ screen dump
(cropped small)

Tim the Frog


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
Fields explaination and COde explaination needed JayJG Microsoft Word Help 3 January 16th 05 05:52 PM
How do I use the PRINT field code to ... Dave Microsoft Word Help 3 December 13th 04 04:06 PM
Converting field results to hard text Thomas Payne Formatting Long Documents 7 December 10th 04 07:39 PM


All times are GMT +1. The time now is 03:02 AM.

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"