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.
Did you try something like
Dim Word.Application as oWordApp =
DirectCast(System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application"),
Word.Application)
Tomy