![]() |
|
#2
|
||||
|
||||
|
While my friend Greg Maxey and I have similar initials, we are not the same person and it is he who is 'Greg'.
The macro Doug supplied is not compatible with the add-in process as even if it was, the macro runs before the document filename is created and thus before it is saved so it cannot reflect the name of that document in its footer. If the aim is to add the filename to the footer then you can get the name of the document (not the PDF file) with Code:
Sub FooterTx(oDoc As Document)
Dim i As Long
Dim fname As Range
With oDoc
Set fname = .Sections(1).Footers(wdHeaderFooterPrimary).Range
fname.End = fname.End - 1
fname.Collapse 0
fname.Fields.Add fname, wdFieldFileName, " \p", False
End With
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
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 |