Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
I've got a mailmerge set up (VBA) merging data from Access 2007 to Word
2007. Everything works fine EXCEPT for trying to get a chart snapshot file included in the merge document. Each merge record includes a field with the complete path to the required snapshot file and in the merge document I've included this merge field: { IncludePicture "{ MergeField PathToChart }" } After executing the merge, this field becomes something like: { IncludePicture "C:\\thepath\\tothechart\\chart.snp" } But that's as far as it goes; while the code seems to be correct, it doesn't get executed as part of the merge. I have tried selecting the document and pressing F9 to recalculate but no joy. Manually inserting the snapshot works fine but I just can't get it automated. I've already seen the info suggested in another msg at http://www.gmayor.com/mail_merge_graphics.htm and http://homepage.swissonline.ch/cindy...r/MergFram.htm but got no further. Anyone have any other tips? Has anyone actually gotten this kind of thing to work in Office 2007? Thanks for any help |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
Did you use Ctrl+F9 to insert the outer { } in the field construction
{ IncludePicture "{ MergeField PathToChart }" } I am guessing that you probably entered them from the keyboard using Shift+[ and Shift+]. That will not work. If you did enter them correctly, try pressing Alt+F9 to toggle off the display of the field codes. -- 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 "Ronn" wrote in message ... I've got a mailmerge set up (VBA) merging data from Access 2007 to Word 2007. Everything works fine EXCEPT for trying to get a chart snapshot file included in the merge document. Each merge record includes a field with the complete path to the required snapshot file and in the merge document I've included this merge field: { IncludePicture "{ MergeField PathToChart }" } After executing the merge, this field becomes something like: { IncludePicture "C:\\thepath\\tothechart\\chart.snp" } But that's as far as it goes; while the code seems to be correct, it doesn't get executed as part of the merge. I have tried selecting the document and pressing F9 to recalculate but no joy. Manually inserting the snapshot works fine but I just can't get it automated. I've already seen the info suggested in another msg at http://www.gmayor.com/mail_merge_graphics.htm and http://homepage.swissonline.ch/cindy...r/MergFram.htm but got no further. Anyone have any other tips? Has anyone actually gotten this kind of thing to work in Office 2007? Thanks for any help |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
Hi Doug.
Yes, I used Ctrl+F9. If I toggle Alt+F9, the whole merge code disappears/appears like it should so I think that means they were entered correctly. .... Ron On Sun, 17 Aug 2008 07:30:48 +1000, Doug Robbins - Word MVP wrote: Did you use Ctrl+F9 to insert the outer { } in the field construction { IncludePicture "{ MergeField PathToChart }" } I am guessing that you probably entered them from the keyboard using Shift+[ and Shift+]. That will not work. If you did enter them correctly, try pressing Alt+F9 to toggle off the display of the field codes. |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
In that case, you may need to use Ctrl+A to select the whole document and
then F9 to update the fields. -- 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 "Ronn" wrote in message .. . Hi Doug. Yes, I used Ctrl+F9. If I toggle Alt+F9, the whole merge code disappears/appears like it should so I think that means they were entered correctly. ... Ron On Sun, 17 Aug 2008 07:30:48 +1000, Doug Robbins - Word MVP wrote: Did you use Ctrl+F9 to insert the outer { } in the field construction { IncludePicture "{ MergeField PathToChart }" } I am guessing that you probably entered them from the keyboard using Shift+[ and Shift+]. That will not work. If you did enter them correctly, try pressing Alt+F9 to toggle off the display of the field codes. |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
In message of Sat, 16 Aug
2008 16:33:05 in microsoft.public.word.mailmerge.fields, Ronn writes I've got a mailmerge set up (VBA) merging data from Access 2007 to Word 2007. Everything works fine EXCEPT for trying to get a chart snapshot file included in the merge document. Each merge record includes a field with the complete path to the required snapshot file and in the merge document I've included this merge field: { IncludePicture "{ MergeField PathToChart }" } After executing the merge, this field becomes something like: { IncludePicture "C:\\thepath\\tothechart\\chart.snp" } But that's as far as it goes; while the code seems to be correct, it [snip] Anyone have any other tips? Has anyone actually gotten this kind of thing to work in Office 2007? Thanks for any help Ronn, I had a similar problem with Word 2003 and INCLUDETEXT. Can you try this? { IF 1 = 1 { IncludePicture "{ MergeField PathToChart }" } } My theory is that this is first evaluated as { IF 1 = 1 { IncludePicture "C:\\thepath\\tothechart\\chart.snp" } } and the IF condition is then evaluated causing the picture to appear. It is a bit ugly, but beats manual opinion using Alt+F9 as Doug Robbins suggests to you and as Peter Jamieson suggested to me. I don't have Office 2007 and don't use pictures and am a naive user compared with the experts here, but think I may have found something interesting in this opaquely documented feature of word. I arrived at a guess of something to try using ancient knowledge of the C language Pre-Processor which does analogous things with text. As always, I would value feedback on my suggestion. -- Walter Briscoe |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
Yup, I've done that too. Well, I'll kust keep bashing away at it or try
some other method (if I can think of one!). I'm assuming from your responses that you have actually seen this working with Office 2007, yes? So there must be something else at play. Thanks for your help. .... Ron On Sun, 17 Aug 2008 18:24:04 +1000, Doug Robbins - Word MVP wrote: In that case, you may need to use Ctrl+A to select the whole document and then F9 to update the fields. |
#7
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
I have not tried it with a .snp file, but in an ordinary document do you get
a picture if you use just { IncludePicture "C:\\thepath\\tothechart\\chart.snp" } -- 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 "Ronn" wrote in message ... Yup, I've done that too. Well, I'll kust keep bashing away at it or try some other method (if I can think of one!). I'm assuming from your responses that you have actually seen this working with Office 2007, yes? So there must be something else at play. Thanks for your help. ... Ron On Sun, 17 Aug 2008 18:24:04 +1000, Doug Robbins - Word MVP wrote: In that case, you may need to use Ctrl+A to select the whole document and then F9 to update the fields. |
#8
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
Thanks for trying, Walter, but unfortunately it didn't work. The conclusion
I've come to is that merging snapshot files (or pdf files which I could make do with) just doesn't work. It works manually, but not automated. If I had bmp files it automates -- but I don't, and can't! So my next thought is to insert placeholder text for each snap, complete the merge and then loop through the merged document, use FIND to find the placeholders and use AddOLEObject to embed the files. Again, in theory and manually, this works. But when automating, each time my Access code hits the Word "Find" command, Access crashes. No specific error, just a crash. I've posted this problem to a different newsgroup in the hopes someone has run into this before and solved it. Until then, I continue as a rat in a maze! Thanks again for your effort. .... Ron On Sun, 17 Aug 2008 11:32:34 +0100, Walter Briscoe wrote: Ronn, I had a similar problem with Word 2003 and INCLUDETEXT. Can you try this? { IF 1 = 1 { IncludePicture "{ MergeField PathToChart }" } } My theory is that this is first evaluated as { IF 1 = 1 { IncludePicture "C:\\thepath\\tothechart\\chart.snp" } } and the IF condition is then evaluated causing the picture to appear. It is a bit ugly, but beats manual opinion using Alt+F9 as Doug Robbins suggests to you and as Peter Jamieson suggested to me. I don't have Office 2007 and don't use pictures and am a naive user compared with the experts here, but think I may have found something interesting in this opaquely documented feature of word. I arrived at a guess of something to try using ancient knowledge of the C language Pre-Processor which does analogous things with text. As always, I would value feedback on my suggestion. |
#9
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
Yes, I've been able to do the same thing manually (which initially gave me
hope!) It just seems that automating it is the problem -- automation does work with bmp files (for example) but not with .snp or .pdf files. On Mon, 18 Aug 2008 05:46:05 +1000, Doug Robbins - Word MVP wrote: I have not tried it with a .snp file, but in an ordinary document do you get a picture if you use just { IncludePicture "C:\\thepath\\tothechart\\chart.snp" } |
#10
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
If you have the .snp in the form of a .pdf. have you tried opening it in
Acrobat and saving it as a .jpg -- 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 "Ronn" wrote in message ... Thanks for trying, Walter, but unfortunately it didn't work. The conclusion I've come to is that merging snapshot files (or pdf files which I could make do with) just doesn't work. It works manually, but not automated. If I had bmp files it automates -- but I don't, and can't! So my next thought is to insert placeholder text for each snap, complete the merge and then loop through the merged document, use FIND to find the placeholders and use AddOLEObject to embed the files. Again, in theory and manually, this works. But when automating, each time my Access code hits the Word "Find" command, Access crashes. No specific error, just a crash. I've posted this problem to a different newsgroup in the hopes someone has run into this before and solved it. Until then, I continue as a rat in a maze! Thanks again for your effort. ... Ron On Sun, 17 Aug 2008 11:32:34 +0100, Walter Briscoe wrote: Ronn, I had a similar problem with Word 2003 and INCLUDETEXT. Can you try this? { IF 1 = 1 { IncludePicture "{ MergeField PathToChart }" } } My theory is that this is first evaluated as { IF 1 = 1 { IncludePicture "C:\\thepath\\tothechart\\chart.snp" } } and the IF condition is then evaluated causing the picture to appear. It is a bit ugly, but beats manual opinion using Alt+F9 as Doug Robbins suggests to you and as Peter Jamieson suggested to me. I don't have Office 2007 and don't use pictures and am a naive user compared with the experts here, but think I may have found something interesting in this opaquely documented feature of word. I arrived at a guess of something to try using ancient knowledge of the C language Pre-Processor which does analogous things with text. As always, I would value feedback on my suggestion. |
#11
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge from Access 2007 to Word 2007
Each of these snapshots (about 75 of them) is a chart generated in Access.
I had poor luck with the quality of jpg or png versions of these charts so ended up not going that route. But the good news is -- ta da -- my application now works! I gave up completely on trying to merge the snapshots through automation and also had no luck merging pdfs. Ended up merging the full paths to the snapshot files as text into the Word document, then searching for the .snp lines, grabbing the whole path line and stuffing it into the FileName argument of an AddOLEObject. This embedded the chart snapshot and I then fritzed around with sizing, etc. to place it correctly. All this was controlled from VBA in Access. Not very elegant perhaps but it works! Thanks again for your suggestions Doug and Walter. .... Ron On Tue, 19 Aug 2008 05:23:57 +1000, Doug Robbins - Word MVP wrote: If you have the .snp in the form of a .pdf. have you tried opening it in Acrobat and saving it as a .jpg |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Merge Access form/subform fields into Word 2007 document? | Mailmerge | |||
Merge access into Word 2007 | Tables | |||
Word and Access 2007 Mail Merge Problem | Mailmerge | |||
Can I mail merge from Access 2007 to Word 2003? | Mailmerge | |||
insert Access 2007 database table into a Word 2007 doc and print | Microsoft Word Help |