andyah
Goto Top

CSharp Word läßt sich nicht fernsteuern Problem mit Word?

CSharp Word läßt sich nicht fernsteuern! trotz vorhandenem Verweis
(Problem mit Word?)

Hi NG,

ich habe ein Problem mit der Fernsteuerung von Word 2010 per VS 2008.

Fehlermeldung:

Das COM-Objekt des Typs "Microsoft.Office.Interop.Word.ApplicationClass" kann nicht in den Schnittstellentyp "Microsoft.Office.Interop.Word._Application" umgewandelt werden

Code:

using Word = Microsoft.Office.Interop.Word;

Word.Application wo;
wo = new Word.Application();

wo.Visible = true;

Wo liegt hier mein (Denk)Fehler?

Gruß
Andy

Content-Key: 179445

Url: https://administrator.de/contentid/179445

Printed on: April 25, 2024 at 04:04 o'clock

Mitglied: 104596
104596 Aug 06, 2012 at 09:21:17 (UTC)
Goto Top
Hi Andy,

du hast vermutlich 2 Sachen vergessen.
Punkt 1: Du musst bei den Verweisen (engl. References) unter COM Microsoft.Office.Interop.Word hinzufügen.

Punkt 2:

Microsoft.Office.Interop.Word.Application wo;
wo = new Microsoft.Office.Interop.Word.Application();

wo.Visible = true;

so funktionierts face-smile

Viele Grüße,
Pat