473,466 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

calling word from .net

Hi
I want to automate word from c# program and i used the
sample solution from MSDN to see how it works
..
I have .NET 2003 / office 2000
the sample solution comes with a WORD.DLL

When i executed, i got a run time error :
An unhandled exception of
type 'System.InvalidCastException' occurred in Example1.exe

Additional information: QueryInterface for interface
Word._Application failed.

What could be the problem ? Can someone help me with an
answer.
Many Thanks
sudha

Nov 22 '05 #1
4 1924
Hi,

Which Word version do you have?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"sudha" <su*******@hotmail.com> wrote in message
news:01****************************@phx.gbl...
Hi
I want to automate word from c# program and i used the
sample solution from MSDN to see how it works
.
I have .NET 2003 / office 2000
the sample solution comes with a WORD.DLL

When i executed, i got a run time error :
An unhandled exception of
type 'System.InvalidCastException' occurred in Example1.exe

Additional information: QueryInterface for interface
Word._Application failed.

What could be the problem ? Can someone help me with an
answer.
Many Thanks
sudha

Nov 22 '05 #2
Hi,

Which Word version do you have?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"sudha" <su*******@hotmail.com> wrote in message
news:01****************************@phx.gbl...
Hi
I want to automate word from c# program and i used the
sample solution from MSDN to see how it works
.
I have .NET 2003 / office 2000
the sample solution comes with a WORD.DLL

When i executed, i got a run time error :
An unhandled exception of
type 'System.InvalidCastException' occurred in Example1.exe

Additional information: QueryInterface for interface
Word._Application failed.

What could be the problem ? Can someone help me with an
answer.
Many Thanks
sudha

Nov 22 '05 #3
On Thu, 13 Nov 2003 23:21:31 -0800, "sudha" <su*******@hotmail.com> wrote:

¤ Hi
¤ I want to automate word from c# program and i used the
¤ sample solution from MSDN to see how it works
¤ .
¤ I have .NET 2003 / office 2000
¤ the sample solution comes with a WORD.DLL
¤
¤ When i executed, i got a run time error :
¤ An unhandled exception of
¤ type 'System.InvalidCastException' occurred in Example1.exe
¤
¤ Additional information: QueryInterface for interface
¤ Word._Application failed.
¤
¤ What could be the problem ? Can someone help me with an
¤ answer.

You may want to post the line of code that is causing the error.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 22 '05 #4
On Thu, 13 Nov 2003 23:21:31 -0800, "sudha" <su*******@hotmail.com> wrote:

¤ Hi
¤ I want to automate word from c# program and i used the
¤ sample solution from MSDN to see how it works
¤ .
¤ I have .NET 2003 / office 2000
¤ the sample solution comes with a WORD.DLL
¤
¤ When i executed, i got a run time error :
¤ An unhandled exception of
¤ type 'System.InvalidCastException' occurred in Example1.exe
¤
¤ Additional information: QueryInterface for interface
¤ Word._Application failed.
¤
¤ What could be the problem ? Can someone help me with an
¤ answer.

You may want to post the line of code that is causing the error.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 22 '05 #5

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

Similar topics

2
by: sudha | last post by:
Hi I want to automate word from c# program and i used the sample solution from MSDN to see how it works .. I have .NET 2003 / office 2000 the sample solution comes with a WORD.DLL When i...
1
by: Asapi | last post by:
1. Are linkage convention and calling convention referring to the same thing? 2. Does calling convention differ between languages C and C++? 3. How does calling convention differ between...
19
by: Ross A. Finlayson | last post by:
Hi, I hope you can help me understand the varargs facility. Say I am programming in ISO C including stdarg.h and I declare a function as so: void log_printf(const char* logfilename, const...
1
by: webstuff | last post by:
Hi, I'm getting a 'Type mismatch' exception when calling the Word.Application.Documents.Open method when using the Office XP 2003 PIAs. the actual error is: ...
8
by: Rob Kellow | last post by:
Hello, I'm working on an application for use within my company on our intranet that will be used to gather some information and store some of the info in a SQL Server database and the rest of the...
0
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
3
by: Scupper | last post by:
I am working on adapting a process currently handled by VBA functions in a Word template, moving to a VB.NET app that calls Word only when necessary to manipulate documents (essentially, it is...
7
by: John | last post by:
Hi I am opening word from my vb.net app. Is there a way to call a procedure in the vb.net app from a word macro? Thanks Regards
47
by: teju | last post by:
hi, i am trying 2 merge 2 projects into one project.One project is using c language and the other one is using c++ code. both are working very fine independently.But now i need to merge both...
0
by: saijin | last post by:
I'm planning to call a list of data from an XML file but when I duplicate the content inside the <data></data> it is not showing anything Here's the ActionScript 3.0 import...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.