Sorry, I'm not directly answering your question. But just wanted to make a comment.
I've briefly worked on editing a Word file from .NET as well and came to the conclusion that MS Office (COM interop) + .NET is not a good solution. If you need to support a range of MS Word versions, or you develop on more than one computer and each has different versions of Word, then you will be in trouble. You are bound to the specific version of Word you started working with and different versions of Word have different feature sets and even for the same feature, the feature's COM accessible method/function may change between versions of Word.
The solution I went with was to do all my Word editing via VBScript and have my .NET app execute the VBScripts as an external process (e.g. shell execute via the Process class). And to develop my VBScripts, I use the Word macro recorder to generate the basic code, then copy the resulting VBA code and modify it into standalone VBScript that can run with Windows Scripting Host. With this solution, you can modify and debug your Word editing code much easier and faster than having to go into the .NET app, modify it, recompile, debug. With VBScript, you don't have to recompile. You also make the overall app more modular and maintainable (in my opinion) by decoupling the code that modifies the Word file from the code for the rest of your application.
Main Topics
Browse All Topics





by: CSecurityPosted on 2008-08-15 at 16:57:11ID: 22242569
Check this: com/Upload File/mgold / WordDocum ent0418200 5081441AM/ WordDocume nt.aspx
http://www.vbdotnetheaven.