Activate Task

J

Janfry

In Windows XP, Word 2003 SP2, I use Task.Activate() to give focus to the Word
window to show the document I've launched, but the Word-task doesn't activate
itself, it remains blinking and I must click with the mouse to show the Word.

I've tested with Task.Activate(True) and Task.Activate(False),
Task.Visible(True), Task.WindowState, etc..
but nothing works, always blinking.

However, if Word is not launched before, all works fine always, even with
Active(True).

Any suggestions or comments would be appreciated.

Regards,
Janfry
 
C

Cindy M.

Hi =?Utf-8?B?SmFuZnJ5?=,
In Windows XP, Word 2003 SP2, I use Task.Activate() to give focus to the Word
window to show the document I've launched, but the Word-task doesn't activate
itself, it remains blinking and I must click with the mouse to show the Word.

I've tested with Task.Activate(True) and Task.Activate(False),
Task.Visible(True), Task.WindowState, etc..
but nothing works, always blinking.

However, if Word is not launched before, all works fine always, even with
Active(True).
Mmm. Which programming language are you using? Please show us the code you use
to work with the Word application so that we can get an idea what's going on?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
J

Janfry

I'm using Java, with Jacob to communicate with Word
(http://sourceforge.net/projects/jacob-project/).

This does not work:

Dispatch.call(msWord.getWordObject(), "Activate");

Neither this:
Dispatch tasks = Dispatch.get(msWord.getWordObject(),
"Tasks").toDispatch();
Dispatch task = Dispatch.call( tasks, "Item", "Microsoft
Word").toDispatch();
Dispatch.put(task, "Visible", new Variant(true));
Dispatch.call(task, "Activate", new Variant(false));
Dispatch.put(task, "WindowState", new Variant(1)); //
dWindowStateMaximize

The Word is activated, but not opened, only blinking in the task bar.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top