elderfubeca
2008-07-31 14:16:02 UTC
I've got a VB.NET application that does find/replace in documents. If I do a
find/replace in the header using the following code, the header size seems to
augment visually--though the actual header size doesn't change. It almost
appears to not close properly or something. And then I can't get the header
to size back to its original size no matter what I do. This same code seems
to work in a Macro, so it seems to be an Interop issue.
WordDoc.Application.ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
WordDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range.Find.Execute(FindText:="BOB", Forward:=True, ReplaceWith:="Bob", Replace:=wdReplaceAll)
WordDoc.Application.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Any ideas as to what I'm doing wrong?
Thanks
find/replace in the header using the following code, the header size seems to
augment visually--though the actual header size doesn't change. It almost
appears to not close properly or something. And then I can't get the header
to size back to its original size no matter what I do. This same code seems
to work in a Macro, so it seems to be an Interop issue.
WordDoc.Application.ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
WordDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range.Find.Execute(FindText:="BOB", Forward:=True, ReplaceWith:="Bob", Replace:=wdReplaceAll)
WordDoc.Application.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Any ideas as to what I'm doing wrong?
Thanks