However, the document does have two sections, and each section does have a
header. So, I'm stumped.
Any suggestions (preferably with explanation, or a clue where I can learn
what I'm doing wrong, etc.)
would be much appreciated.
Thanks, marceepoo
Here's the code:
Dim sSourcDocFulnam, sTargetDocFulnam
sSourcDocFulnam = "C:\Apps\test.speedText.doc.dot"
sTargetDocFulnam = "C:\Apps\New Microsoft Word Document.doc"
'
Set objWord = CreateObject("Word.Application")
'
Set objSourcDoc = objWord.Documents.Open(sSourcDocFulnam)
Set objSourcRange =
objSourcDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range.text
'
Set objTargetDoc = objWord.Documents.Open(sTargetDocFulnam)
Set objTargetRange =
objTargetDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range.text
'
objTargetRange = objSourcRange
set bjSourcRange = objSourcDoc.Sections(1).Headers(1).Range
wscript.echo bjSourcRange.Text
Y Sakuda from JPN