Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > word automation find and replace

Reply
Thread Tools

word automation find and replace

 
 
James Vitale
Guest
Posts: n/a
 
      09-16-2005
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?ZGhucml2ZXJzaWRl?=
Guest
Posts: n/a
 
      09-16-2005
Hi James

Nice to know someone else is automating word with asp.net!

I haven't done header/footer myself but there should be something in the
following search results page that will help ya...

http://www.pillage.com/search/Word_V...nd_Footer.html

Cheers


Dan



"James Vitale" wrote:

> 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
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I find explicit self much easier to understand if i replace it in mymind with the word "instance" frolib@gmail.com Python 3 04-01-2009 09:01 AM
Supressing the ctrl-c and other keys during word automation in automation apondu ASP .Net 0 07-19-2007 09:10 PM
ASP.NET and MS Word Find and Replace Error Jordan ASP .Net 1 12-12-2006 01:05 AM
Find and replace a word in a file using java rynox Java 4 11-18-2005 03:28 PM
Modifying a Word document without using Word Automation Michael G. Schneider ASP General 5 12-16-2003 06:52 PM



Advertisments