|
| interop problems |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.vsnet.vstools.office.
| SteveG |
| GOOD ANSWER |
interop problems.. using Vb.net 2002 using MS Word 9.0 objects as reference. computer running xp pro MS Word2000
''Keep getting this same error... INVALID CAST EXCEPTION''
TRIED USING EXCEL EXAMPLE AND I GET THE SAME ERROR any ms office example I try to run fails....
System.InvalidCastException: QueryInterface for interface Word._Application failed. at Word.ApplicationClass.get_Application() at WordMailMerge.Form1.Button1_Click(Object sender, EventArgs e) in C:\Documents and
Settings\Steve\Desktop\VB.NET - Windows Forms - Simple Printing\WordMailMerge\Form1.vb:line 94 at System.Windows.Forms.Control.OnClick(EventArgs e)
on button click in Vb.net 'Start Word and open the document template. 93 oWord = CreateObject("Word.Application") 'this line runs 94 oWord.Application.Visible = True ''''this line FAILS 95 oWord.Visible = CBool(True) ''this line fails also
get same result if I comment out line 94 and run line 95
I put this line at the top of the form module Imports Word = Microsoft.Office.Interop.Word 'it put a squigly line under ms.office.interop.word'
'mouse over line says "Namespace or type "Word" for the imports Microsoft.Office.Interop.Word' cannot be found
|
|
|
| |
|
|
| |
| | |
| |
| Richie Weldon [MSFT] |
| GOOD ANSWER |
Hi Steve,
It looks like you're trying to develop a solution using Microsoft Word 9.0. You may want to post this message in one of the Word newsgroups (like microsoft.public.word.programming). This newsgroup is designed for people having trouble with the Visual Studio Tools for Office product. (Please see http://msdn.microsoft.com/vstudio/office/ for more information regarding Visual Studio Tools for Office.)
Richie Weldon Trinity - Customer Solutions QA team
--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm -------------------- << Content-Class: urn:content-classes:message << From: "SteveG" <Click here to reveal e-mail address> << Sender: "SteveG" <Click here to reveal e-mail address> << Subject: interop problems << Date: Fri, 16 May 2003 12:49:22 -0700 << Lines: 38 << Message-ID: <03ff01c31be4$3f43fea0$Click here to reveal e-mail address> << MIME-Version: 1.0 << Content-Type: text/plain; << charset="iso-8859-1" << Content-Transfer-Encoding: 7bit << X-Newsreader: Microsoft CDO for Windows 2000 << Thread-Index: AcMb5D9D+Dgma7+rTdethgR3JcEw4Q== << X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 << Newsgroups: microsoft.public.vsnet.vstools.office << Path: cpmsftngxa06.phx.gbl << Xref: cpmsftngxa06.phx.gbl microsoft.public.vsnet.vstools.office:322 << NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161 << X-Tomcat-NG: microsoft.public.vsnet.vstools.office << << interop problems.. using Vb.net 2002 << using MS Word 9.0 objects as reference. << computer running xp pro << MS Word2000 << << ''Keep getting this same error... INVALID CAST EXCEPTION'' << << TRIED USING EXCEL EXAMPLE AND I GET THE SAME ERROR << any ms office example I try to run fails.... << << System.InvalidCastException: QueryInterface for interface << Word._Application failed. << at Word.ApplicationClass.get_Application() << at WordMailMerge.Form1.Button1_Click(Object sender, << EventArgs e) in C:\Documents and << << Settings\Steve\Desktop\VB.NET - Windows Forms - Simple << Printing\WordMailMerge\Form1.vb:line 94 << at System.Windows.Forms.Control.OnClick(EventArgs e) << << on button click in Vb.net << 'Start Word and open the document template. << 93 oWord = CreateObject("Word.Application") 'this << line runs << 94 oWord.Application.Visible = True ''''this << line FAILS << 95 oWord.Visible = CBool(True) ''this line << fails also << << get same result if I comment out line 94 and run line 95 << << << I put this line at the top of the form module << Imports Word = Microsoft.Office.Interop.Word 'it put a << squigly line under ms.office.interop.word' << << 'mouse over line says "Namespace or type "Word" for the << imports Microsoft.Office.Interop.Word' cannot be found <<
|
|
|
| |
|
|
| |
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|