473,385 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1923
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.