473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Word replace from charp

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
Jul 21 '05 #1
3 1323
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






Jul 21 '05 #2
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?

"Fergus Cooney" <fi****@post.com> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl...
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






Jul 21 '05 #3
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?


"Fergus Cooney" <fi****@post.com> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl...
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






Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

41
by: Ruby Tuesday | last post by:
Hi, I was wondering if expert can give me some lite to convert my word table into access database. Note: within each cell of my word table(s), some has multi-line data in it. In addition, there...
2
by: Christopher Beltran | last post by:
I am currently trying to replace certain strings, not single characters, with other strings inside a word document which is then sent to a browser as a binary file. Right now, I read in the word...
0
by: David Krmpotic | last post by:
Regards, I need a little explanation in converting word VB macros to charp code! first, I recorded simple macro which replaces every occurence of one word in whole document (is it?) , here:...
1
by: James Vitale | last post by:
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...
3
by: David Krmpotic | last post by:
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...
6
by: Gary Bond | last post by:
Hi All, Being a bit of a newbie with regex, I am confused when using word boundaries. For instance, I want to replace all the stand alone '.5k' that occur in an input string, with 500. In other...
1
by: Michael Yanowitz | last post by:
Hello: I am hoping someone knows if there is an easier way to do this or someone already implemented something that does this, rather than reinventing the wheel: I have been using the...
2
by: Ola K | last post by:
Hi guys, I wrote a script that works *almost* perfectly, and this lack of perfection simply puzzles me. I simply cannot point the whys, so any help on it will be appreciated. I paste it all here,...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.