![]() |
|
#1
|
|||
|
|||
|
We often have a need to create cover pages for technical documents submitted to clients. Mail Merge to a PDF seems to be the simplest solution. I've read several posts on the subject: But ended up using a AddIn from "Greg Mayor" (http://www.gmayor.com/individual_merge_letters.htm) as it has provided me the a "best fit" solution. The AddIn permits me to "...run a macro before saving the documents..." with a caveat that... Quote:
Code:
Sub FormatTM(oDoc As Document)
Dim oRng As Range
Set oRng = oDoc.Range
With oRng.Find
Do While .Execute(FindText:=ChrW(174))
With oRng.Font
.name = "Segoe UI"
.Superscript = True
End With
Loop
End With
End Sub
Code:
Sub FooterTx()(oDoc As Document)
Dim i As Long, Source As Document, Target As Document, Letter As Range
Dim fname As Range
Set Source = ActiveDocument
With Source
For i = 1 To .Sections.Count
Set fname = .Sections(i).Footers(wdHeaderFooterPrimary).Range
fname.End = fname.End - 1
Set Letter = .Sections(i).Range
Letter.End = Letter.End - 1
Set Target = Documents.Add
With Target
.Range.FormattedText = Letter.FormattedText
.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = ""
.SaveAs FileName:=fname.Text & " - Contributions", FileFormat:=wdFormatPDF
.Close wdDoNotSaveChanges
End With
Next i
End With
End Sub
Doug Robbins code by itself works for me, but not in the Addit. Anyone's help would be appreciated. |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| showing mail merge all in one file | lezawang | Mail Merge | 3 | 05-24-2018 03:10 PM |
Log file for mail merge
|
neilclelland | Mail Merge | 7 | 12-08-2016 03:08 PM |
| some records disappear after emailing mail merged file | Dr Ennui | Mail Merge | 1 | 06-10-2015 04:17 PM |
Mail Merge is Deleting objects in my header and footer during the merge
|
bgranzow | Mail Merge | 9 | 06-05-2015 05:03 AM |
how do i ad a specific pdf file to a mail merge?
|
mseibel | Mail Merge | 1 | 08-28-2012 07:53 PM |