View Single Post
 
Old 07-25-2024, 09:33 AM
annguye2 annguye2 is offline Mac OS X Office 2021
Novice
 
Join Date: Jul 2024
Posts: 22
annguye2 is on a distinguished road
Default

Thanks, I followed the instructions AND found it works.
However:
- It works when on a target document that is empty.
- For the document that fully filled with information, it's showing error on paste.
My guess is that it needs time for completing the edit at PASTE action, but I don't know how to deal with it.
Please advise!

Here is the part of code where it is stuck (Bolded) and the error message is "(run time error 4505, This method or property is not available because the current selection is locked for editing"


' First Page Footers copy and paste
Set footer1 = docTemplate.Sections(1).Footers(wdHeaderFooterFirs tPage)
Set footer2 = doc.Sections(1).Footers(wdHeaderFooterFirstPage)
doc.PageSetup.DifferentFirstPageHeaderFooter = True
footer1.Range.Copy
footer2.Range.Paste
Set footer1 = Nothing
Set footer2 = Nothing
Reply With Quote