Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word 97 SR-2 very strange
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00700081
Message ID:
00700754
Views:
9
>>>I've got an strange one here.
>>>
>>>If you create a new instance of Word and change its WindowState to 2 (Minimised) then set its Visibility to .T. the resulting instance of Word has no Menu bars?
>>>
>>>Does anyone know why this happens and if there is a way of turning the bars back on?
>>>
>>>Thanks in anticipation.
>>
>>You need to activate word application before changing/setting windowstate:
>>"...Use the Activate method to activate a window prior to setting the window state..." (VBA for Word Help on "Windowstate property").
>>The problem is that you can not activate invisible word application. But if it is visible, then you do not need to issue additional 'activate'.
>>
>>So why not to use this:
>>oword=createobj....
>>oword.visible=.t.
>>oword.Windowstate=2
>>....
>Yuri,
>
>That is exactly what I am using, but as I am making word visible then minimising it, it flashes on the screen, so I thought I could stop that by changing its state before I made it visible. But if I can't I can't.
>
>Thanks again for the input.

This will do what you need, I think.

oWord = CREATEOBJECT("Word.Application")
local lnleft
with oWord
lnleft=.Application.left
.Application.left=-1000
.Visible=.t.
.Visible=.f.
.Application.left=lnleft
.WindowState=2
....
Previous
Reply
Map
View

Click here to load this message in the networking platform