Last post Dec 24, 2008 07:17 PM by sameer kamarudeen
Dec 18, 2008 10:42 AM|aramadan66|LINK
I am using micorosft word from my web application to create a word document, i do not need to open word on the server, just to create the document in the backend and save it,
in my application in the local comuputer i added a refrence to the following dll:
everthing is working fine, but
on the server, there is no word installed, nor the mentined dll, i am not sure how i deploy the dll on the server
Any help plz, Thanks
Dec 18, 2008 11:12 AM|DarrellNorton|LINK
You have to install the Primary Interop Assemblies:
Note that this is not the best way to create Word documents on an ASP.NET server. You will not be able to support a lot of concurrent users. Check out
OfficeWriter or similar products.
Dec 18, 2008 12:36 PM|aramadan66|LINK
Thanks for your reply, i did downloaded this and try to install it, it tells me that i have to install MS Office 2007!, i thoght installing the assembly will be an alternative for installing the MS Office.
correct me if i am wrong.
Dec 18, 2008 12:38 PM|aramadan66|LINK
while i am trying to isntall this assembly, it tells me that i have to isntall the ms office product!, i thought this will be an alternative for installing the office. correct me if am wrong
Dec 18, 2008 05:05 PM|devcalpoly|LINK
Seems like Office installation will be required.
Dec 21, 2008 03:03 PM|TATWORTH|LINK
Installing Office on a server is not recommended by Microsoft. You will need to use the COm+ explorer to locate class entries and set permissions. Getting this right repeatedly is quite difficult. Be prepared to detect problems and develop means by which
you can be promptly notified of them as Office can lock up and only be released by logging onto the server and starting Office.
Dec 21, 2008 06:49 PM|aramadan66|LINK
Thanks, but what is the other option you recommend, i need to generate a word document from the backend, how can i acheive this without installing MS word
Dec 22, 2008 02:22 AM|TATWORTH|LINK
>without installing MS word
If an Office 2007 format is acceptable, then you could generate a word document as XML.
For further details , please ask at http://social.msdn.microsoft.com/forums/en-US/vsto/threads/
Dec 22, 2008 03:06 PM|sameer kamarudeen|LINK
Do you prefer to create word document as xml format. Office 2003 support word document as xml.
so you can use an xslt which define word body content.
Dec 22, 2008 03:16 PM|aramadan66|LINK
I do not need to create a word document from scratch, i have a ready made template and all what i need is to populate some information from database in this template.
which way is easier ?
thanks fro reply
Dec 22, 2008 03:57 PM|MTCowboy|LINK
I just went through this myself and am faily new with VB.NET so there may be better ways however after studying on it I opted to take my word doc, save to xml format after adding some fields to fill. Now I basically have a text document (xml). My fields
are just the text with names from my Web form like "wf_name" "wf_Addrress" etc. Now all my server needs to do is copy my original word xml doc, load up the text from the doc in a var, perform a simple find and replace of the text in the XML document replacing
wf_name with Jim etc from my form, and write the stream back to the drive. Now you have a word doc in xml with the specified fields filled.. Very fast and none of the complexity I had with working with Word on the server side which is not recommended. You
are basically just doing a find/replace in a text document. Requires Word 2003 or later to handle the XML document as a Word Doc.
Dec 22, 2008 04:13 PM|sameer kamarudeen|LINK
double click your template (.dot) file and save the word file as xml. Add some place holder xml tag to inject your data.
Iterate xml to find out the xml tag (It would be eazy to name your tag with the property name) and replace tag with the actual data.
If its table then use an another xslt to generate multipole rows based on data. And insert in place holder where ever you wand.
Dec 22, 2008 05:06 PM|TATWORTH|LINK
With Office 2007 the XML format type documents can be readily spliced together either with a text editor or programmatically - no need to uwse the word object model and hence no word components need be installed.
Dec 22, 2008 05:18 PM|aramadan66|LINK
i will be really appreciated if you can pass in any sample code showing the way you have tried it .
Dec 22, 2008 05:49 PM|TATWORTH|LINK
Have alook at the MSDN nugget video at
This and some of the other "Office Open Xml" will demonstrate the technique.
Dec 22, 2008 06:01 PM|TATWORTH|LINK
Also have a look at the following:
Dec 22, 2008 06:40 PM|sameer kamarudeen|LINK
its very simple...create a document and save as xml. Then insert some text in <w:p><w:r><w:t>you text goes here </w:p></w:r></w:t>.
It just xml manipulation.
Dec 23, 2008 10:04 AM|aramadan66|LINK
that link does not work, would you please post another link, am just looking for a sample code as i am not familiar with this technique nore xml
Dec 23, 2008 10:12 AM|TATWORTH|LINK
>that link does not work, would you please post another link, am just looking for a sample code
Which link does not work please?
Dec 23, 2008 03:42 PM|aramadan66|LINK
I mean this one for the vedio: http://www.microsoft.com/uk/msdn/screencasts/screencast/234/Structuring-Documents-in-Word-2007-Building-Blocks.aspx
Dec 24, 2008 04:38 AM|TATWORTH|LINK
Try downloading the Video from
Dec 24, 2008 08:57 AM|aramadan66|LINK
Thanks, but there is nothing there about development using open xml format.
Dec 24, 2008 07:17 PM|sameer kamarudeen|LINK
dude.. create a document in office 2003 type some thing and save it as xml. Then open the xml in an xml editor. You can see how it is structured. Hope this will give you an idea.