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 / October 2005

Tip: Looking for answers? Try searching our database.

Disable Maximize and minimze menu of a Word document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
d.gallone@aubay.lu - 17 Oct 2005 15:03 GMT
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
 
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.