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 / Outlook / Programming VBA / September 2005

Tip: Looking for answers? Try searching our database.

Set Ms Word application size to equal Outlook application size ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Harold M Little - 22 Sep 2005 02:47 GMT
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
Eric Legault [MVP - Outlook] - 22 Sep 2005 21:12 GMT
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.

Signature

Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard - http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/

> 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.
[quoted text clipped - 6 lines]
>  wd.Width = olk.ActiveExplorer.Width
>  wd.Height = olk.ActiveExplorer.Height
Harold M Little - 23 Sep 2005 02:16 GMT
Works perfectly,

Thank You - Eric

> Harold, I have some code at this link that explains how to use the
> Win32API
[quoted text clipped - 32 lines]
>>  wd.Width = olk.ActiveExplorer.Width
>>  wd.Height = olk.ActiveExplorer.Height
 
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.