Set Ms Word application size to equal Outlook application size ?

  • Thread starter Thread starter Harold M Little
  • Start date Start date
H

Harold M Little

I launch MS Word from with in Outlook, once Word is open,
I want to set the application window size to exactly fit on top of Outlook.
Is there a conversion or function to force word to overlay outlook
perfectly?
I use the following snippet,but the windows never align properly.
'
wd.Top = olk.ActiveExplorer.Top
wd.Left = olk.ActiveExplorer.Left
wd.Width = olk.ActiveExplorer.Width
wd.Height = olk.ActiveExplorer.Height
 
Harold, I have some code at this link that explains how to use the Win32API
to determine the size of the available screen:

Tiling The Reply Message For Easy Reference:
http://blogs.officezealot.com/legault/archive/2004/01/19/251.aspx

You can then use those values to calculate how wide/tall you want those
windows to be. Keep in mind that for the Word window and the Outlook
Explorer window, you'll have to set both window states to normal before you
resize them:

Word:
ActiveDocument.ActiveWindow.WindowState = wdWindowStateNormal

Outlook:
ActiveExplorer.WindowsState = olNormalWindow

Also note that Word reports sizing and positioning property values as
points, while Outlook uses pixels. The values returned from the
SystemParametersInfo call are expressed in pixels too I believe. You can use
the Application.PixelsToPoints method in Word to convert.
 
Works perfectly,

Thank You - Eric

Eric Legault said:
Harold, I have some code at this link that explains how to use the
Win32API
to determine the size of the available screen:

Tiling The Reply Message For Easy Reference:
http://blogs.officezealot.com/legault/archive/2004/01/19/251.aspx

You can then use those values to calculate how wide/tall you want those
windows to be. Keep in mind that for the Word window and the Outlook
Explorer window, you'll have to set both window states to normal before
you
resize them:

Word:
ActiveDocument.ActiveWindow.WindowState = wdWindowStateNormal

Outlook:
ActiveExplorer.WindowsState = olNormalWindow

Also note that Word reports sizing and positioning property values as
points, while Outlook uses pixels. The values returned from the
SystemParametersInfo call are expressed in pixels too I believe. You can
use
the Application.PixelsToPoints method in Word to convert.
 
Back
Top