View Single Post
 
Old 03-05-2015, 07:22 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The template is not open unless your open it.
You don't have to open it to extract the header from it, but you do to select something in it, so if you are going to use the selection object you must open it first, and as it was opened in the previous code, you can add the following before you close it

Code:
oTarget.Sections(1).Headers(wdHeaderFooterFirstPage).Range.FormattedText = _
oSource.Sections(1).Headers(wdHeaderFooterFirstPage).Range.FormattedText
If the document is created from the template, why doesn't it already have the information in the header and elsewhere?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote