.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

asp.net 2.0 word automation issue

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

i 've VS2005 (asp.net 2.0) and i'm developing a intranet applcaition.

i want to create/open word files on the client side , that can be editable and can be saved on to the database.

all of the client systems will have Word 2007 installed. please suggets what approach should i take.

i tried with COM word automation but there are a lot of security/permissions issue associated and its not working fine.

please advise.

thanks in advance







View Complete Post

More Related Resource Links

Word Automation Issue in Windows Server 2008 Hosting



The problem I am posting here is that I was facing nearly 2 weeks around. Any body comes with this stuff please help.

Word Automation in sample ASP.NET(C#) application.

I am using Microsoft.Office.Inetrop.Word Assembly for automation. Here I am reading a XXX.dot template file and fill the contents with dynamic data.

When i am executing my code in localhost:someportnumber the automation is working fine and I could get expected result and when I am hosting in my inetmgr(Windows XP is my OS) it is also working fine.

But the problem is that when I am hosting in my production server(Windows Server 2008 Standard Edition) I am not able to perform automation and results in the following error.

Data: System.Collections.ListDictionaryInternal
Message: Word has encountered a problem.
Source: Microsoft Word

The code gets failed in the following line:

ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();

Document wordDoc = wordApp.Documents.Add(ref oTemplate, ref oFalse, ref oMissing, ref oMissing); // Error in this line

I cannot able to proceed further. Can anybody please help me in solving this issue?

Thank you.

With Regards,


Word Automation - Multiple DCOM Errors/Behavior

Before I get started, I already know that Microsoft does not support and highly discourages server-based MS Office automation.  I've read a multitude of posts and smarmy "*wink*, here's a link" replies, so I'm looking for actual help here, not condescending reprimands.

That notwithstanding, here is my problem.  I have developed a simple method that will open a local Word document, modify some header information, and then save the document as a new file.  As expected, it works great as a console/windows app, but as soon as I went to ASP.NET, DCOM jacked my world up when accessing the app remotely from a different domain account (that has access to the ASP.NET app.  For reference, my method is shown below:


1    public static string ModifyAndSaveBuildDocument(string localFilePath, BuildDocumentType docType, string buildNumber, DateTime buildDate, string projectName)
2            {
3                try
4                {
5                    ProjectConfiguration config = (ProjectConfiguration)ConfigurationManager.GetSection("ProjectConfiguration");

Re-authentication issue when openeing a MS Word Document


We have a SharePoint installation for one of our clients with external access enabled using https via ISA server. When accessing the portal internally within the intranet/domain its fine. In case of external access using https when users login to portal adn when they try to open a MS Word (or any Office) document they are prompted to to enter their username and password again. It happens for every MS Office document. We are using MOSS 2007, Office 2007. I know that the promp for re-authentication is is due to the fact that office try to open a new session but is there any work around to overcome this.

Any help will be highly appreciated.



Developing with SharePoint 2010 Word Automation Services

Using the Open XML SDK 2.0 in combination with Word Automation Services enables many scenarios that are difficult when using only the Open XML SDK 2.0, such as repagination, conversion to other document formats, or updating dynamic content in documents.

Developing Applications in SharePoint 2010 Using Word Automation Services and Excel Services

Learn about the new client services features that are available in SharePoint Server 2010, including Word Automation Services and Excel Services.

Sample: Developing Applications in SharePoint 2010 Using Word Automation Services and Excel Services

Download sample code that demonstrates the new client services features that are available in SharePoint Server 2010, including Word Automation Services and Excel Services.

Sample: Converting Word Documents to PDF using SharePoint Server 2010 and Word Automation Services

Explore the code in this visual how-to article as you learn how to programmatically convert Word documents to PDF format on the server by using Word Automation Services with SharePoint Server 2010.

Word automation under asp.net 1.1.4322 & Vista 64-bit

(this problem was solved, please refer to my later reply down in this thread)We have an asp.net 1.1.4322 application running successfully under Windows XP Pro 32-bit , Windows Server 2003 32-bit and Windows Vista Ultimate 32-Bit.In this application we are successfully generating/saving/opening Word documents, and we were able to successfully upgrade from Word 2000 to Word 2007 without problems, under both platforms.When installing and running the same application under Vista SP1 64-bit we faced a problem with automating Word. We tried giving all permissions possible, we tried impersonating in Web.Config, we tried running the IIS process as Administrator, we searched the internet and tried many solutions we found out there, but nothing seemed to fix the problem.Investigating under Task Manager, I can see that WINWORD is launched as:"C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE" /Automation -Embeddingbut the code crashes at a line like this:oDoc = oWord.Documents.Add(ref documentTemplate, ref oMissing, ref oMissing, ref oMissing);Generating this error:COMException (0x800a13e9): Word has encountered a problem.I have a feeling that this has to do with 32-bit/64-bit system dlls related to the Dcom Launcher, and during my search I came across this article which suggested checking some dlls and making sure they match the same version:http://support.microsoft.

Issue with Excel automation in C#

Hi, I am dynamically creating an excel file with some list options using C#. There will be 3 or more columns with drop down list. The issue is that in some columns there will not be values in some rows. But the drop down list shows all the empty column values also. Is there a way by which I can filter the excel column with all non empty values? Sample Code  Range r = (Range)ExcelWS.Columns.get_Item(c.Ordinal + 1, Missing.Value);r.Validation.Add(XlDVType.xlValidateList, XlDVAlertStyle.xlValidAlertStop, Missing.Value, "=$B:$B", Missing.Value);r.Validation.ErrorMessage = "Please select from available options";r.Validation.IgnoreBlank = true;r.Validation.ShowError = true;r.Validation.InCellDropdown = true;  

Does Word Automation Services require Office 2010 install on server to function?


Subject is the question.


My requirements are to "maintain existing functionality with current version of a windows service running on Server 2003 and automating Word through COM."   I.E. All the stuff that breaks when you upgrade the OS to Server 2008.  

My customer has already rejected several third party alternatives as "not being accurate enough"  The rendered PDF doesn't match what comes out of Word when compared with an electron microscope.

So now I'm investigating using Word Automation Services and Sharepoint 2010.   Got my development server functional with Sharepoint 2010 and Visual Studio 2010.  But my first attempts at creating rendering jobs is failing with an "ArgumentNullException" in deep inside a method I'm 100.0% sure I'm NOT passing any NULL's to. 

My VM is low on space so I figure I'd save time by asking for a conclusive answer before I make room / install Office.

SSRS Word Export Issue- Last Column Data getting Trim


We are exporting a SSRS report in Word. The last colum is getting displayed without its right side vertical bar. Data is also getting trim. Please let us know the solution on this.


Opening Word without Automation in ASP.net C#


Hi all,

I am been having trouble with finding an answer to this question but here goes:

Is there any way to write to MSWORD without automation through ASP.NET in C# (maybe write to an existing word document without opening it)?

I am pulling my hair out! I have tried adding IUSR, ASPNET to the web server, I have tried Identity Impersonate = True in the web.config.

My code for opening word looks like this:

object isVisible = true;
object readOnly = true;

I get a Macro storage error on the open statement. I have put a lot of time into figuring this out and I really dont want to do a TOTAL 180.

wordDoc = WordObj.Documents.Open2000(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible);

I appreciate any ideas or suggestions given! 

 Thank you in advance!


Word Automation Services


we want to use the Word Automation Services in Sharepoint. Therefore I tried to configure a new Word Automation Service like described in this msdn article ( http://msdn.microsoft.com/en-us/library/ee557330(office.14).aspx) but I can't find the option new->"Word Conversion Service Application".

I can only create a new connection to a word service application proxy. Could it be that I missed to install it during the configuration wizzard?
Or do I use the wrong Version of Sharepoint 2010? What is the difference between "Sharepoint 2010 Enterprice CAL Feature" and "Sharepoint 2010 for Internetsites"?



Issue with Excel and Word Export - SSRS 2008


Hi there,

          I have created fairy simple report having a table in body section and Header, Footer. I have set the Report Properties

Orientation - Landscape

Paper Size - Custom

Width - 11in & Height - 8 in

Margins - Left 0.25 in , Right 0.25 in, Top 0.5 in, Botton 0.5 in

Issue NO 1: When i export the report to Excel, it takes margin as Left 0.75 in , Right 0.75 in, Top 1 in, Botton 1 in, because of this some part of my Report is cut. what should i do to keep margins of Excel as per margins set in RDL.

Issue No 2: In Footer excel shows Page 1 of 1 for all the pages

Expression used :



"Page" & Globals!PageNumber & " of " & Globals!TotalPages;

Issue No 3: when i export the Report to word, it does not consider landscape and show only middle part of report, cut rest of the report data.

COM exception on Win-2003 STD Edition SP2 (For Word Automation)


Hi there,


I have deployed my Web Application (.Net framework 2.0) on Windows Server-2003 STD Edition SP2

and i have also given the Administrator impersonation into web.config

"<identity impersonate="true" userName="user-name" password="password"/>"


and am developing and Word Automation Application which contains only 3 lines of code for time being

 object oMissing = System.Reflection.Missing.Value;
 Microsoft.Office.Interop.Word.ApplicationClass oWord = new Microsoft.Office.Interop.Word.ApplicationClass();
 oWord.Quit(ref oMissing, ref oMissing, ref oMissing);


with the referenc library Microsoft.Ofiice.Interop.Word


which works fine into local system when given with impersonation,   but when deployed the same application onto server and i have also given the server Administrator impersonation but also its not allowing me to access the COM factory and its throwing me the error as


Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154.



am not getting still what more security issue i need to configure onto

Word Automation through Windows service (Windows Server 2008) - Problem

I went through the thread in this link http://social.msdn.microsoft.com/Forums/en-US/netfx64bit/thread/65a355ce-49c1-47f1-8c12-d9cf5f23c53e (which is a very similar problem to mine), but couldnt solve my problem.
I seem to face a very related problem in word automation.
I have created a windows service which creates a sample word document (WORD 2007) and then converts it to a .doc file (WORD 2003 format) or a PDF file , based on requirement.  Let me post the sample code here :

Chapter 10: Word Automation Services (SharePoint 2010 Web App The Complete Reference)

Learn how to build Word web-based applications in Microsoft SharePoint 2010 by using OpenXML.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend