473,668 Members | 2,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help!! Problem instantiating WORD object using C#.NET

I am trying to open the content of a WORD file from C#.NET which resides
in the REMOTE SERVER, however I get an error:
"System.Runtime .InteropService s.COMException: Server execution failed"
when declaring new Word.Applicatio nClass().

string fileName = this.btnWorkOrd er1.Value;
object readOnly = false;
object isVisible = false;
object saveChanges = false;
object missing = System.Reflecti on.Missing.Valu e;
object dynamic = 2;

//error here:
Word.Applicatio nClass oWordApp = new Word.Applicatio nClass();

Word.Document oWordDoc = oWordApp.Docume nts.Open(ref file, ref missing,
ref readOnly, ref missing, ref missing, ref missing, ref missing, ref
missing, ref missing,
ref missing, ref missing, ref isVisible);
Does anybody know how to solve it? Please help!!!

Thanks alot!!!

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
1 1335
Sounds like you may not have the correct dll reference for your version of
word. Check what version of word you are running against your COM dll

--
Terry Burns
http://TrainingOn.net
"Handy Mulia" <ha********@gma il.com> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
I am trying to open the content of a WORD file from C#.NET which resides
in the REMOTE SERVER, however I get an error:
"System.Runtime .InteropService s.COMException: Server execution failed"
when declaring new Word.Applicatio nClass().

string fileName = this.btnWorkOrd er1.Value;
object readOnly = false;
object isVisible = false;
object saveChanges = false;
object missing = System.Reflecti on.Missing.Valu e;
object dynamic = 2;

//error here:
Word.Applicatio nClass oWordApp = new Word.Applicatio nClass();

Word.Document oWordDoc = oWordApp.Docume nts.Open(ref file, ref missing,
ref readOnly, ref missing, ref missing, ref missing, ref missing, ref
missing, ref missing,
ref missing, ref missing, ref isVisible);
Does anybody know how to solve it? Please help!!!

Thanks alot!!!

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1647
by: Ronny Sigo | last post by:
Hello all, In my application I have to open a predefined MS Word document. I do this with the following code: Dim sDatum As String sDatum = Date Dim sNaamschrijver As String Dim appWord As Word.Application Dim wrdDoc As Word.Document Dim strFileName As String
1
1789
by: Sakharam Phapale | last post by:
Hi All, I am working on Text editor. We are using Microsoft Word object for Spelling checking and correcting. Now I want to add new word in Word dictionary using Word object. Can anyone guide me how to achieve my goal. Any suggestions will be appreciated. Thanks and Regards.
0
5706
by: Balakrsihna | last post by:
Hi All, Can anyone tell me how to replace an image in MS Word 2003 using c#.net. I am converting an html file to word doc and sending this as attachment using System.Web.Mail; the recipient could not see the image in attachment. I am using Inlinepicture.Addpicture but still not working
1
1474
by: Handy Mulia | last post by:
Hi experts, I am trying to open the content of a WORD file from C#.NET which resides in the REMOTE SERVER, however I get an error: "System.Runtime.InteropServices.COMException: Server execution failed" when declaring new Word.ApplicationClass(). string fileName = this.btnWorkOrder1.Value; object readOnly = false; object isVisible = false;
3
3844
by: Martin Austin | last post by:
Here's my problem. I'm launching an MS Word object on a Notes document Postopen event. The script kicks off a macro that saves the Word document to a temporary file every n minutes (backup of key data). This works fine apart from Notes kind of hangs because it is waiting on the macro to finish. This never happens because the macro is using timer code to save every n minutes. The solution sounds simple, start the macro on the Word...
1
1086
by: Gomathi | last post by:
hi all, In my windows application, i added a word object reference. Using word object, i'm doing spell checking. After spell checking, i quited the word object. But still its running in task manager and utilizing 100% in CPU. How to solve this?. I attached the code which i used in my application. string strVal = "Good"; Word.Application oWord = new Word.Application(); object missingType = Type.Missing;
0
1297
by: Ronald S. Cook | last post by:
I'm trying to open the Word object model, read some text and then close the document and app. But I get this when trying to close the document and application... Ambiguity between method 'Word._Document.Close(ref object, ref object, ref object)' and non-method 'Word.DocumentEvents2_Event.Close'. Using method group. D:\Win\Nightclub\Nightclub\frmMain.cs Ambiguity between method 'Word._Application.Quit(ref object, ref object, ref...
0
1115
by: Ronald S. Cook | last post by:
I'm trying to open the Word object model, read some text and then close the document and app. But I get this. Ambiguity between method 'Word._Document.Close(ref object, ref object, ref object)' and non-method 'Word.DocumentEvents2_Event.Close'. Using method group. D:\Win\Nightclub\Nightclub\frmMain.csAmbiguity between method 'Word._Application.Quit(ref object, ref object, ref object)' and non-method...
0
4000
by: funeeldy | last post by:
I need to locate a particular table in a document. I cannot hardcode the table number since it could be different in every doc. I do have some header text that comes right before it consistently, though. So, I tried to find that text, and then move to the next table. Then I need to add a row to the table which already has 4 columns. I need to maintain the old content of the table too. I think I am pretty close, but having a little trouble...
0
1748
by: Pramod Elig | last post by:
I developed this code which works fine in my current system which has office 2007, but when I run in word 2000 this doesn’t work. Can you please help me to code word automation using late binding. I want to create text, tables. Word.Application WApp = new Word.Application(); // Open Microsoft Word application object objMissing = System.Reflection.Missing.Value; // create the place holder object Word.Document...
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8378
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8577
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4376
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2786
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.