Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Paste data to already open word document.

1 view
Skip to first unread message

musa.biralo

unread,
Jul 4, 2009, 9:29:30 PM7/4/09
to
Hello and Greetings:

I am trying to paste my text to already open word document using VSTO,
VB.NET. I have the file name of the open word document in my task bar.

Let's say, "Docuement 1 - Microsoft Word" is open and I can see that
in my taskbar. Now how can i activate the "Docuement 1 - Microsoft
Word" and paste a string to it?

If I do "Dim wordApp As New Word.Application", this will create new
word document which i don't want. And if I just use "Dim wordApp As
Word.Application" will throw null reference error.

I am trapped. Please carry me out.

Musa.Biralo.

Tomy Varghese

unread,
Aug 3, 2009, 5:35:14 AM8/3/09
to


Did you try something like

Dim Word.Application as oWordApp =
DirectCast(System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application"),
Word.Application)

Tomy

0 new messages