.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

Word Automation - Multiple DCOM Errors/Behavior

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net
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");

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,


Autocomplete with multiple word suggestions, How can we do in Asp.Net with Ajax?


Hi All,

Could you please let me know the process to get multiple word suggesions for a text box in asp.net using Ajax.  

Actually I got a solution for that,


But it used Atlas. When I am running with this code in my application, it is conflicting with Script Manager that is already there in Masterpage.

How can I overcome that problem. Is there any built-in solution in latest versions of Ajax?


Thanks in Advance,

Sateesh Nagalla,



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.

asp.net 2.0 word automation issue


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







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.

Export Multiple Gridviews To Word

Hi, I am trying to export multiple gridviews to Word.  I am able to do this but what i want to do is add some headings and text in between each grivdiew.  Please see my code below i am using to export the gridviews.         Response.Buffer = True        Response.ContentType = "Application/vnd.ms-word"        Response.ContentEncoding = System.Text.Encoding.Default        Response.AddHeader("content-disposition", "attachment;filename=evaluation_report.doc")        EnableViewState = False        Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter        Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)         dv_course_information.RenderControl(oHtmlTextWriter)        gv_gp_practices.RenderControl(oHtmlTextWriter)        gv_attendance_summary.RenderControl(oHtmlTextWriter)        gv_useful_activities.RenderControl(oHtmlTextWriter)         Response.Write(oSt

Multiple-step OLE DB operation generated errors in Pre-Execute

Hello, I am getting below error; what could be the reason? The input is valid adn works good if I give to a multicast for test. But I get below error when I use OLEDB Destination ("table or view fast load") as my target. Note: Columns mappings are done auto by SSIS and All looks good as my source and destination are having same names as well. [Stage - Issue [33923]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E21. An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80040E21  Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". [Stage - Issue [33923]] Error: Cannot create an OLE DB accessor. Verify that the column metadata is valid. [DTS.Pipeline] Error: component "Stage - Issue" (33923) failed the pre-execute phase and returned error code 0xC0202025. Thanks, Prabhat

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.

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"?



Parsing Words from Multiple Recordsets - Returning With Word Counts


I've had too many sleepless nights trying to work this out - I hope I can get some help here.

I have three distinct ADO recordsets that I need to parse words from and return to the client with sorted full word counts (less a predefined dictionary of innocuous words e.g. a, an, the, of.) across all three, references to the original record and references to the original source. The user needs to be able to drill in and out of this result set.

I'm going to simplify the layout for clarification purposes.

Let's say each data source has three identical fields 'updatedTime' (DateTime), 'text'(VARCHAR(255)) and 'ID'.

User goes to the site and searches for the word 'frog'.
User is returned with a word count of every record that has the word 'frog' in the 'text' field sorted by the top count down.
'green' 18 times in table A, 12 times in table B, 22 times in table C
'hop' 16 times in table A, 13 times in table B, 6 times in table C.
'roadkill' 12, 11, 4
'red' 10, 12, 3
And so on.

User clicks on the word 'green'.
Now only words with both 'frog' AND 'green' in the original record show up (again, with the counts and sorted by count).
A breadcrumb is built, so the user can click on 'frog' again to kill that filter.
User decides he doesn't want the default timeframe (6 months) and adjusts a filter

External Data Fields in a Word Template saved as a content type in a document library with multiple


I have created a Word Template for a Document Library that has an External Data Column in it of Client Name which also adds Client Address1, Client Address2, Client City, Client State, & Client Zip.  Now this works fine for a Document library with that template as the Template.dotx file. 

I want to be able to make a bunch of Templates and have them all as Content Types in one Library.  When I do this I cannot get the External Data Quick Parts to work.

Anyone have any ideas?

Cannot find Microsoft Word Application in DCOM



I would like to config the Microsoft Word Application in DCOM for some function in my project.  So, I completely installed the Microsoft Office Professional Edition 2003 (32-bit version) in my server and go to the DCOM Config.  Actually, I can't find the object "Microsoft Word Application" but the "Microsoft Excel Application" is here.

I don't know it should cause by the OS version or not.  The OS is using Microsoft Server 2003 R2 64-bit Edition with SP2.

Do anyone have advise for me?


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

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