Link to home
Start Free TrialLog in
Avatar of QuaLjyn
QuaLjyn

asked on

Interop with Word XP/2002 in C#

Using Visual Studio .NET and C#, I have tried interacting with word. I've read some of the tutorials found lying around, but somehow they don't apply to my reality :|

Some of the members described in the examples doesn't apply to my references, like myWordInstance.Documents() - at my computer, the only thing that looks like that is myWordInstance.get_Documents().

Can any of you give my some advice (by code or by pointing at some material), that shows how to open a word document programatically, and preferably hidden, parses through a document, and shuts down again?

By the way, i have tried using the pia's, using Add reference to the word interop dll and pointing at the WOrd 10 object library COM object... neither worked at my comp, since i couldn't interface the members...
Avatar of QuaLjyn
QuaLjyn

ASKER

can i close this, if i got things working?
Avatar of QuaLjyn

ASKER

well, guess not... then the question is changed to "How do i parse through the document?"
ASKER CERTIFIED SOLUTION
Avatar of Sijin
Sijin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of QuaLjyn

ASKER

well, managed to do it myself, but since one can't close questions, thanx for the help :)
I've had to cut out some stuff cause there was some problem submitting the comment. Anyways this is the code that i am using to generate keywords for a word document based on some rules, hope this helps you get a idea on how to do what you want to do :)

for hidden use   app.Visible = false;
for parsing use  doc.Words

anything else just see thru the code.
I guess that you are not using this anymore... but just for the record.

Accessing Word (or any office app) through .net is very slow. A much faster way is to use VBA. With VBA, you are able to do almost everything you can with c#.

Just my 5 cents