View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Vic[_2_] Vic[_2_] is offline
external usenet poster
 
Posts: 18
Default Merging PDF Documents

Thanks Doug ! I'll see what I can pit together!

Vic

"Doug Robbins - Word MVP" wrote in message
...
I believe that the only way to do that will be after executing the merge to
a new document and then run a macro using code that searches for each tag
and at its location inserts the .pdf

Something like

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="tag", Forward:=True, _
MatchWildcards:=False, Wrap:=wdFindStop, MatchCase:=False) = True
Selection.InlineShapes.AddOLEObject
ClassType:="AcroExch.Document.7", _
filename:="C:\Temp\T0017.pdf", LinkToFile:=False, _
DisplayAsIcon:=False
Loop
End With

where "tag" is the text of the tag that you have inserted into the mail
merge main document

--
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, originally posted via msnews.microsoft.com
"Vic" wrote in message
...
I have a VB6 application that does a mail merge using an Access database
which works fine for database fields. I now have a requirement that it
also do a merge of PDF documents. These documents will be Crystal reports
that will be turned into PDF files. I will need to insert multiple {tags}
that will identify which PDF file to insert. Can someone tell me how to
go about doing this, maybe some sample code?

I think this will work for inserting the PDF:

Selection.InlineShapes.AddOLEObject ClassType:="AcroExch.Document.7",
_
FileName:="C:\Temp\T0017.pdf", LinkToFile:=False,
DisplayAsIcon:=False

No now I need to know a method of serching for {tags}. Any ideas? I'm
using Word 2007.


Thanks ,


Vic