Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

Activate Task

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Janfry - 14 Jun 2007 15:39 GMT
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
Cindy M. - 15 Jun 2007 08:49 GMT
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
[quoted text clipped - 6 lines]
> 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 :-)
Janfry - 15 Jun 2007 12:05 GMT
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,

> Hi =?Utf-8?B?SmFuZnJ5?=,
>
[quoted text clipped - 19 lines]
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.