Yes you did. Now I will be able to print the last page and the page the precedes it regardless of how many pages the document has. I thought it was impossible to code something like that. Wonderful.Originally Posted by fumei
[VBA]With Selection
.EndKey Unit:=wdStory
.InsertBreak Type:=wdSectionBreakNextPage
.InsertFile FileName:="Other.doc", Range:=""
End With[/VBA]
For the future reference, in case someone comes here seeking for the same thing, here's Fumei's code. It will automatically insert another file as the last page keeping it's original heading in the process, and then it will automatically print that page and the page before, regardless of the number of pages that the original document has. All of this in one macro, which means one click.
Big thanks to Fumei, macropod and all the rest who spent time in writing this code.