Word replace from charp

  • Thread starter Thread starter David Krmpotic
  • Start date Start date
D

David Krmpotic

hi!!

I would like to open an existing Word document and make few Replace
actions.. for example I want to replace every occasion of word 'day' with
word 'night'..
I know about automation and I examined one example of Excel automation..
Then I looked into Msword9.olb :: Word._Document if I could find replace
function there.. but not.. So please tell me what's the procedure to achieve
the desired action ? just give me the guidelines, I'll work my way from
there...

Thank you a lot!!

David
 
Hi David,

One way of working with Office Apps is to go into the App and start a VBA project.
Write some code there that will do the job and then go back to .NET and implement the same
code through Automation.

There's no Intellisense and Help for Office from within .NET but Office, of course, is
the native environment for VBA.

Regards,
Fergus
 
Thank you for reply, but I didn't understand how exactly would I do that..
maybe it's obvious but still... could you explain a little more please?
 
I have another (=the same?) idea.. what if I could dinamically write VB
Macro and execute it on the document.. that would make replace and many
other things possible to do... do you know how to do that?
 

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

Back
Top