AtariJag64
Programmer
I'm trying to programmatically edit a Word Document in C#.
I want to open the file, edit the file via Bookmarks, and then save it.
From my research, I've found that you have to go to "Add Reference" and add the MSWord9 reference to the project. This I have done.
The code looks like this:
private Word.Application WordObj = null;
InitializeComponent();
WordObj = new Word.ApplicationClass();
Now this WordObj gives all of the member functions that I need; however, the parameters all ask for "ref object" data types.
for example:
WordObj.Documents.Open( )
This is where you can specify the document to open, etc., but all of the arguments within .Open() are of type "ref object"--which won't convert from strings or ints.
Has anyone experimented with any of this before, and can maybe give me a push in the right direction?
Thanks guys,
-Chris Bryant
I want to open the file, edit the file via Bookmarks, and then save it.
From my research, I've found that you have to go to "Add Reference" and add the MSWord9 reference to the project. This I have done.
The code looks like this:
private Word.Application WordObj = null;
InitializeComponent();
WordObj = new Word.ApplicationClass();
Now this WordObj gives all of the member functions that I need; however, the parameters all ask for "ref object" data types.
for example:
WordObj.Documents.Open( )
This is where you can specify the document to open, etc., but all of the arguments within .Open() are of type "ref object"--which won't convert from strings or ints.
Has anyone experimented with any of this before, and can maybe give me a push in the right direction?
Thanks guys,
-Chris Bryant