Quote:
Originally Posted by PolarPop
For clarification, in my documents, 3 lines would be closely defined as 3 rows. The first is document number, the second is the document effective date, and the third is the page number (page x of y). Each line ends with a ^p.
|
That means you have 3 paragraphs, not merely a paragraph of 3 lines, in which case -and assuming you want to replace those 3 paragraphs - you could use:
Code:
Set wdRngTgt = .Range.Paragraphs.First
wdRngTgt.MoveEnd wdParagraph, 2
Set wdRngSrc = wdDocSrc.Sections.First.Headers(HdFt.Index).Range.Paragraphs.First
wdRngSrc.MoveEnd wdParagraph, 2
wdRngTgt.FormattedText = wdRngSrc.FormattedText
Quote:
Originally Posted by PolarPop
What does this do?
Code:
wdRngTgt.FormattedText = wdRngSrc.FormattedText
|
This does essentially the same as a copy/paste that preserves the source formatting, but without using the clipboard.