Hello, friends,
In c#.net 2005, we have the following source, hoping to bring a Word window
to front. However, it does not work.
Any ideas? How to bring a Word window to front?
Thanks a lot.
------------------- source code
foreach (Microsoft.Office.Interop.Word.Document doc in this.wordApp.Documents)
{
if (String.Compare(doc.Path + "\\" + doc.Name, fullPathFileName, true)
== 0)
{
doc.Activate();
return;
}
}
Roßert G. Schaffrath - 29 Mar 2008 16:02 GMT
I don't believe you can bring the document to the foreground with
doc.Activate() call, only make it the active document. You should call
this.wordApp.Activate() after doc.Activate() to bring the Word window to
the foreground.
Robert
> Hello, friends,
>
[quoted text clipped - 16 lines]
> }
> }