Form size

V

Vince

I was wondering how I could resize the activeword document so that it fills
half the screen and have my form fill up the second half. I want to do what
Word does when you click on Help that comes with Word.

The screen.width and screen.height commands don't seem to work in VBA. I
want this to be resolution independent.

Any ideas?

Thanks for your time.

Vince
 
V

Vince

Never mind, this does it....

Dim Wid As Long
Dim Hei As Long


ActiveWindow.WindowState = wdWindowStateMaximize
Wid = ActiveWindow.Width
Hei = ActiveWindow.Height

ActiveWindow.WindowState = wdWindowStateNormal


ActiveWindow.Width = Wid / 2

StyleManager.Width = Wid / 2 ' StyleManager is my form's name
StyleManager.Height = Hei
StyleManager.Top = 0
StyleManager.Left = Wid / 2

StyleManager.Show
 

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