word automation find and replace

J

James Vitale

Using vb asp.net 1.1

I'm doing a word automation on a doc file and trying to do a find and
replace. My existing code works fine except that it doesn't find and
replace in the header.

My code to set the selection is as follows:

'This sets the selection to be the whole document

wordApp.Selection.HomeKey(Word.WdUnits.wdStory, Word.WdMovementType.wdMove)

' Select from the insertion point to the end of the document.

wordApp.Selection.EndKey(Word.WdUnits.wdStory, Word.WdMovementType.wdExtend)


I then loop through and do a find and replace using
wordApp.Selection.Find.Execute

My problem is, it doesn't Find and Replace in the header and footer. Any
idea on the syntax to automate find and replace there?

Thanks,

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top