Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Resizable VBA forms (dialogs) in Outlook.

79 views
Skip to first unread message

Curtis Clauson

unread,
Jun 3, 2000, 3:00:00 AM6/3/00
to
How do you create a custom VBA form (dialog) in the Outlook VBA editor that is
resizable? When I create the form using "Insert UserForm" it creates a form
with no minimize or maximize buttons on the title bar and which is not
resizable when run. There is no property for the form to control resizing or
those two buttons, though there is a property for a help button. But there is
a resize event for the UserForm object. I can use this event to re-layout my
controls when the form changes size but I cannot find any way to enable the
form to be resized by the user.

The "Visual Basic Programmer's Guide" in the "Office Developer Documentation"
in MSDN, the VBA help you get from the VBA editor menu, and the VBA knowledge
base have no references I can find on how to make a VBA form object resizable
by the user. The only reference I've found is how to programmatically resize
the form to show or hide optional controls through the use of form buttons.

Any assistance that can be provided would be greatly appreciated.

--
The Snake Pit - Development
Curtis Clauson Lle...@best.com
Proprietor


Leah Simpson

unread,
Jun 14, 2000, 3:00:00 AM6/14/00
to
Hello Curtis -

Thank you for your question. We are doing some research on your issue and
will get back to you with our findings.

Leah
Microsoft Developer Support


Stephanie Peters

unread,
Jun 15, 2000, 3:00:00 AM6/15/00
to
Hi Curtis,

To my knowledge there is no mechanism for allowing the user to resize a VBA
UserForm other than to write the code yourself based on the MouseDown,
MouseMove and MouseUp events. Following is a crude example of how you
might go about this. I hope it helps you.

Thanks,
Stephanie Peters
Microsoft Developer Support

*****

Dim intPosX As Integer
Dim intPosY As Integer
Dim DragX As Boolean
Dim DragY As Boolean

Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If X > Me.Width - 10 Then
DragX = True
End If
If Y > Me.Height - 30 Then
DragY = True
End If
End Sub

Private Sub UserForm_MouseUp(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If DragX Then
Me.Width = X
DragX = False
End If
If DragY Then
Me.Height = Y + 20
DragY = False
End If
End Sub


Curtis Clauson

unread,
Jun 15, 2000, 3:00:00 AM6/15/00
to
That's pretty much the conclusion I had come to. I just found it difficult to
believe such a ridiculous thing as the docs simply do not address it.

Thanks for the confirmation.

--
The Snake Pit - Development
Curtis Clauson Lle...@best.com
Proprietor

"Stephanie Peters" <ste...@microsoft.com> wrote in message
news:WIs6vIn1$GA...@cppssbbsa01.microsoft.com...

0 new messages