Hi,
I'm using Word 2002 with VBA.
Is it possible to disable the Maximize and Minimze menu of a Word
document inside Word ?
I try this but no effect :
Dim wrdWnd As Long
Dim x As Long, docwnd As Long
Dim lStyle As Long
Const GWL_STYLE = (-16)
Const WS_MAXIMIZEBOX = &H10000
Const WS_MINIMIZEBOX As Long = &H20000
wrdWnd = FindWindow("OpusApp", 0&)
x = FindWindowEx(wrdWnd&, 0, "_Wwf", "")
x = FindWindowEx(wrdWnd&, x, "_Wwf", "")
docwnd = FindWindowEx(x, 0, "_Wwb", "test.doc")
lStyle = GetWindowLong(docwnd, GWL_STYLE)
--> lStyle has the value "1455489024" but doesn't change after the
following lines
lStyle = lStyle Or (WS_MAXIMIZEBOX) ' Maximize
lStyle = lStyle And Not (WS_MINIMIZEBOX) ' Minimize
Call SetWindowLong(docwnd, GWL_STYLE, lStyle)
It works if I change the Maximize and Minimze menu of Word, but not for
the documents open inside Word!
Thank for your help,
David GALLONE
Word Heretic - 21 Oct 2005 14:13 GMT
G'day d.gallone@aubay.lu,
Write a shell and call word as a client.
Steve Hudson - Word Heretic
steve from wordheretic.com (Email replies require payment)
Without prejudice
d.gallone@aubay.lu reckoned:
>Hi,
>
[quoted text clipped - 27 lines]
>Thank for your help,
> David GALLONE
Tony Jollans - 21 Oct 2005 23:43 GMT
For a single document, in a module in the document add this code:
Sub DocMinimize()
End Sub
Sub DocMaximize()
End Sub
To apply to all documents put it in Normal or another global template
instead.
--
Enjoy,
Tony
> Hi,
>
[quoted text clipped - 27 lines]
> Thank for your help,
> David GALLONE