473,325 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

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 8176
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Roel | last post by:
Hi all, I'm using the FileUpload control for uploading MS Word and MS PowerPoint documents. To check if a user uploads a correct document, I check the contenttype...
2
by: asp.net | last post by:
hello gents, i have a similar thing to do. i am not much into .net yet. i am currently working on asp website which generates doc file on a fly. i now want to convert these doc to docx files. i am...
0
by: manjunathatv | last post by:
I am required to insert bullets to a list of items in a docx document. forexample i have done. <w:p w:rsidR="00FA3E6F" w:rsidRDefault="00FA3E6F" w:rsidP="00D3356D"> - <w:pPr> - <w:numPr> ...
1
by: ll | last post by:
I have a file upload script that has successfully uploaded files, although the MS .docx format will not load for some reason. Has anyone found a workaround/solution to this? Thanks, Louis
2
by: gwen.demby | last post by:
Hello, I hope all is well.. I was wondered if someone had a fix for opening docx file... I am currently using the response.redirect("path of word document") however it does not work while trying to...
2
by: =?Utf-8?B?TWFkaXNvbg==?= | last post by:
Hi there, I'm working with VS 2008(framework3.5), IIS6, SQL Server 2005. I have website that allow users to upload doc, docx, xls, xlsx ... and so on. I save file to SQL Server 2005 with...
4
by: =?Utf-8?B?U1VOTlk=?= | last post by:
Hi, i am uploading a .docx file into sql2005 and later when i retrieve the file from the database and i open it, i get a error message "The file is corrupted and cannot be open". I am not facing...
1
by: mamul | last post by:
Hi All, I am able to read and write to .txt, .bin files. but the same program is not support for .docx file . can someone help me the procedure to perform read write operation on .docx file. ...
0
by: nightscorpion | last post by:
Hello Everyone , im supposed to create a Customer with labels (name,add,Telnr...)and textboxes(thomas ,karsplatz,23423423423) in a windows form. i store all these data in a class...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.