BBC
asked on
VBA/OLE: Maximize Word97 from within Access97
I use the following VBA-code to try to display and maximize Word 97 from within Access 97. Word shows up but isn't maximized. Why ?
My customer also complains that Word starts but does not pop up in front. So they need to click it to front. Has anyone solved these problems ?
Set wrd = CreateObject("Word.Applica tion.8")
<...>
wrd.Visible = True
If wrd.Application.WindowStat e <> wdWindowStateMaximize Then wrd.Application.WindowStat e = wdWindowStateMaximize
My customer also complains that Word starts but does not pop up in front. So they need to click it to front. Has anyone solved these problems ?
Set wrd = CreateObject("Word.Applica
<...>
wrd.Visible = True
If wrd.Application.WindowStat
ASKER
Uhh... I hate magic constants. But this thing is MESSED UP (MS Office).
Your suggestion works, so I'll use it. Thanks.
Did you ever try:
if wrd.WindowState <> 1 Then wrd.WindowState = 1
wrd.Visible = True
You get a different result. You get Word without Word ... ;-)
PS: Submit it as answer and you'll get the points.
Your suggestion works, so I'll use it. Thanks.
Did you ever try:
if wrd.WindowState <> 1 Then wrd.WindowState = 1
wrd.Visible = True
You get a different result. You get Word without Word ... ;-)
PS: Submit it as answer and you'll get the points.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
My first guess is that the constant wdWindowStateMaximize isn't assigned properly. It's value should be 1. Try using the value 1 instead of the constant.
Also... you don't need to use wrd.Application.WindowStat
Try this code. It worked well for me.
Dim wrd As Word.Application
Set wrd = CreateObject("Word.Applica
wrd.Visible = True
If wrd.WindowState <> 1 Then wrd.WindowState = 1
Ture Magnusson
Karlstad, Sweden