word 2007 and C#

G

Gidi

Hi,

I've a windows application using C# (VS 2005).
one of my forms is opening a word document and replacing text and then print
the document.

for some reason, one of the computers i'm using with office 2007 installed,
crashes the program when i try to print the document.

I would like to know if there's a new way to find&replace strings in word
2007 (the document is *.doc).

I'm using:
Microsoft.Office.Interop.Word

Thanks,
Gidi.
 
J

JMiguez

        Hi,

I've a windows application using C# (VS 2005).
one of my forms is opening a word document and replacing text and then print
the document.

for some reason, one of the computers i'm using with office 2007 installed,
crashes the program when i try to print the document.

I would like to know if there's a new way to find&replace strings in word
2007 (the document is *.doc).

I'm using:
Microsoft.Office.Interop.Word

Thanks,
Gidi.

Gidi,

I developed a program in C# sometime back with the same
application, to replace some strings on a MS-Word file.
If the program only replaces a series of strings in MS-Word then it
is more convenient to replace the string(s) at a lower level, that is
at the document's XML level.
It is possible to open most word documents (word 2003, 2007 file
formats) simply with notepad, and there create "tags".
Creating a tag (see examples below) is simple, just choose the
format and word that describes the tag that won't conflict with any
current tags in MS-Word.
Add as many tags needed for the project and in the format that you
choose; the following are some examples of tags that could be created:

Example of tag that could be created:
<mytag_FirstName>
<mytag_LastName>
<mytag_ProjectDescription>
 

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

Top