OL2000: How to Resize a Custom Form When It Is Opened

ID: Q237365


The information in this article applies to:
  • Microsoft Outlook 2000


SUMMARY

This article describes how you can create a custom Outlook form that positions itself in a specific location on the screen.


MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
The Outlook 2000 object model now includes support for positioning and sizing Outlook windows on the screen. This new feature can be used with either folder windows (known as "explorers" in the object model) or item windows ("inspectors").

To create a custom contact form that displays at a specific location when opened, follow these steps:
  1. Open a new contact.


  2. On the Tools menu, point to Forms, and then click Design This Form.


  3. On the Form menu, click View Code. Enter the following Visual Basic Scripting Edition (VBScript) code into the Script Editor, and then close the Script Editor:


  4. 
    Sub Item_Open()
       Set objInspector = Item.GetInspector
       objInspector.Left = 0
       objInspector.Width = 400
       objInspector.Top = 0
       objInspector.Height = 400
       Set objInspector = Nothing
    End Sub 
  5. On the Tools menu, point to Forms, and then click Publish Form. The default is to store the contact form in your Contacts folder. Type Resize Test as the Display Name, and then click Publish.


  6. Close and do not save changes to the form.


To test the form, on the Actions menu, click New Resize Test.

Design Considerations

  • If you have the Windows taskbar docked on the left or top of the screen, setting the Left or Top properties of the Outlook window to zero (0), causes the window to appear under the taskbar.


  • The Outlook object model does not provide support for determining the screen resolution used on a particular computer so you can adjust the form size. If you are programming in an environment that allows access to Windows APIs, then you can access APIs to retrieve this information. Or, if you are programming in VBScript, another approach would be to automate another Microsoft Office application, such as Microsoft Word, to access the System object and use its VerticalResolution and HorizontalResolution properties.



REFERENCES

For additional information about available resources and answers to commonly asked questions about Microsoft Outlook 2000 solutions, please see the following article in the Microsoft Knowledge Base:

Q146636 OL2000: Questions About Custom Forms and Outlook Solutions

Additional query words: OutSol OutSol2000 OL2K

Keywords :
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: July 30, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.