Launching Word from Automation Causes Word to Open Off Screen

T

tag

I am launching Word through automation using the type library in MSWORD9.OLB. Sometimes when I make Word visible to the end user (by setting the Visible property to True and Activating the application object) the main Word application window appears almost entirely off-screen (usually off the top-left corner of the screen). This happens even if I had just closed another instance of Word that was in a normal position on the screen. Can anyone tell me why Word is mispositioning itself and how to get Word to open on screen?
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?dGFnQG5ld3Nncm91cHMubm9zcGFt?=,
I am launching Word through automation using the type library in MSWORD9.OLB. Sometimes
when I make Word visible to the end user (by setting the Visible property to True and
Activating the application object) the main Word application window appears almost
entirely off-screen (usually off the top-left corner of the screen). This happens even if
I had just closed another instance of Word that was in a normal position on the screen.
Can anyone tell me why Word is mispositioning itself and how to get Word to open on
screen?I don't know what could be causing this; can't say I've ever heard of anything quite like
this before. But You can test for the Left and Top values of the application window and
change them.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
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 :)
 
T

tag

Cindy

Thanks for you input. I have tried setting the top and left with no luck. I have noticed that if the Word toolbar is not displayed, this solves the problem but if the Word toolbar is displayed, Word will still be off the screen. Not sure why the toolbar comes and goes. If you have any ideas on this one, I would appreciate the input

Ric
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?dGFnQG5ld3Nncm91cHMubm9zcGFt?=,
Thanks for you input. I have tried setting the top and left with no luck. I have
noticed that if the Word toolbar is not displayed, this solves the problem but if the
Word toolbar is displayed, Word will still be off the screen. Not sure why the toolbar
comes and goes. If you have any ideas on this one, I would appreciate the input.Hmmmm. I've seen this happen if the .Activate and .Visible commands for the Word
application window are in the wrong order. Try reversing the order you use these and see
if that makes a difference?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
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 :)
 
T

tag

We changed the WindowPtr to a Word::_ApplicationPt and this seemed to allow us to control where the Word window displayed and the state that it displayed in. The toolbar now remains on the Word application except in one case in Word 2000. We were forced to normalize the window to keep it on the screen. You can then maximize it without the problem of Word jumping off of the screen. We read the state that Word had when it was shut down last and reset to that state. This allows us to put the Word window up maximized if that is how the user had last left Word. The trick was to force Word to go through the normalized state first. This works except for Word 2000. If the user had Word maximized in 2000, they will not have a toolbar displayed. We have found multiple entries about this problem but have not been able to find a solution. If anyone has a solution that will keep the toolbar on the Word 2000 window, we would greatly appreciate hearing from you

Thank
Ric
 

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