Click here to Skip to main content
15,887,318 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
issue: populating values for word document is not happening.object reference error in production server.

development server( working fine)

i am trying to populate the values for the word document using c#.am using microsoft.office.interop.word dll (version 12.0 related to word 2007) as a reference in my project. in my development server office 2007 is installed. am able to populate the values and save the document properly without any error.

Production Environment

getting object reference error. the one difference i see in this server is microsoft word 2010 is installed. i tried my level best but no luck.

*is this because word 2010 is installed in the production server?

*when i hosted the application in the other production server where word 2007 is installed.the application is working fine.

please suggest me some way so that i can go forward.

Thanks

Dev.
Posted
Updated 8-Jun-16 3:54am
Comments
[no name] 17-May-13 10:06am    
It sounds like you would need to install the Office 2007 DLLs on your production server since that is what you are referencing in your project.

You don't have to have Office installed. In some settings, this is bad or even unacceptable. Please see this Microsoft article: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[^].

Alternatively, you can use Open XML SDK:

http://www.microsoft.com/en-us/download/details.aspx?id=30425[^].

This way, you can support new XML-based Office formats (such as .DOCX, .XLSX), ECMA-376 standard:
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats[^],
http://en.wikipedia.org/wiki/Office_Open_XML[^].

This is another option: http://npoi.codeplex.com/[^].

—SA
 
Share this answer
 
hi i have resolved this issues by using open xml method.

Thanks
Dev
 
Share this answer
 
Comments
Richard Deeming 8-Jun-16 10:20am    
And it only took you slightly over three years to do it?!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900