469,904 Members | 2,482 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

C#, docx

lsg
Hi,
Anybody know how to open docx (MS Word) file, retrive all formfields,
insert text and print in c# ?

Best Regards
Leszek
Nov 28 '07 #1
2 7929
You have two choices:
1) use the Word Object model by setting a COM tab reference to the
appropriate version of Word.

2)Since docx files are XML, parse the Xml with the Office Xml APIs:

http://msdn2.microsoft.com/en-us/library/ms406049.aspx

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"lsg" wrote:
Hi,
Anybody know how to open docx (MS Word) file, retrive all formfields,
insert text and print in c# ?

Best Regards
Leszek
Nov 28 '07 #2
On Nov 28, 2:10 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.comwrote:
You have two choices:
1) use the Word Object model by setting a COM tab reference to the
appropriate version of Word.

2)Since docx files are XML, parse the Xml with the Office Xml APIs:
Docx files are not xml. They are zip files that contain the xml
files. To open them and manipulate their contents, the OP will want
to look at the System.IO.Packaging namepsace from .NET 3.0 and above.

--
Tom Shelton
Nov 29 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Roel | last post: by
2 posts views Thread by asp.net | last post: by
2 posts views Thread by =?Utf-8?B?TWFkaXNvbg==?= | last post: by
4 posts views Thread by =?Utf-8?B?U1VOTlk=?= | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.