You are here:  / Outlook Forum
Home » Outlook addins and plugins development » Developer Outlook add-ins » Outlook Custom form - resize event handling
Outlook Custom form - resize event handling [message #574] Thu, 06 July 2006 13:41 Go to previous message
Messages: 4
Registered: June 2006
Junior Member
Hi all,

I used standard Message template and added custom control (RTF editor) on
the form. I want to make that control resizes when user resizes the new
message window (similar to standard Message textbox).
I hid the standard message textbox and added code in Item_Open() to make my
control overlap original - so initial size and position are correct (see code
below). And I checked the box 'resize with form' for the new control.
However, only control's width got resized with form but its height remained
the same.

Sub Item_Open()
Dim oPage
Dim oTIS, oOld
Set oPage = Item.GetInspector.ModifiedFormPages(1)
Set oTIS = oPage.Controls(oPage.Controls.Count - 1) ' custom control is
the last one
Set oOld = oPage.Controls("Message") ' original textarea
oTIS.Move oOld.Left, oOld.Top, oOld.Width, oOld.Height
Set oTIS = Nothing
Set oPage = Nothing
End Sub
To test that piece of code you can create a form and put new multiline

As workaround I tried to add a hook on parent window and resize my control
whenever parent gets resized... More problems here:
- immediate parent gets lost when form resizing causes vertical scrollbar
disappear or appear;
- when I tried to use next parent then attempts to move
the control based on parent size (GetWindowRect) resulted in weird positions
(and also depended on fact either scrollbar was visible or not);
- I used Spy++ trying to identify windows hierarchy and found discrepancy
between standard mail message form and customized (i.e. some 'F3 Server
600..." window etc.). It seems form customization added some additional

I believe there should be some way to overcome those issues (maybe my
control should expose some interface so it's container will resize it

Any help is highly appreciated!

Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Debugging Word addin when Word is launched by another app
Next Topic:Re: Two CommandBarButtons that run the same event code
Goto Forum:

.:: Home ::.