Word automation : how to bring the document to the front ?
Show older comments
With the following lines I can open a Word document in automation mode:
hComServer = actxserver('Word.Application');
hComServer.Visible = 1;
hComServer.Documents.Open('c:\foo.doc');
but I can't figure out how to bring the window to the front ....
Accepted Answer
More Answers (1)
Jan
on 17 May 2012
Does this work:
hComServer.Visible = 1
or
hComServer.Activate
?
[EDITED]: Perhaps:
oDoc = hComServer.Documents.Open('c:\foo.doc');
oDoc.Activate;
Or:
hComServer.ActiveWindow.Activate();
You can use "methods(hComServer)" to inspect the possibilities.
2 Comments
p fontaine
on 18 May 2012
Jan
on 18 May 2012
Is there a command to get the hWnd of the Word Window? I do not use the Microsoft Office on my Matlab computer, because I need it for serious work, such that I cannot test this. ;-)
Categories
Find more on ActiveX in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!