OlkControl object (Outlook)

Defines a set of control properties common to some Microsoft Outlook controls.

Remarks

The members offered by OlkControl can apply to most Outlook controls. OlkControl provides a class to which you can conveniently cast an Outlook control without resorting to reflection. Although OlkControl does not apply to Microsoft Forms 2.0 controls, similar properties are available to Forms 2.0 controls.

Example

The following code sample uses the OlkControl class to enable automatic resizing of a text box control with respect to any resizing of the form. It uses casting in Visual Basic to allow the text box control to use the properties of OlkControl.

Sub ResizeWithForm() 
 Dim myTextBox As OlkTextBox 
 Dim olkCtrl As OlkControl 
 
 ' Let the text box control use the properties of OlkControl 
 Set olkCtrl = myTextBox 
 
 ' Enable automatic adjustments of the layout with respect to the rest of the form 
 olkCtrl.EnableAutoLayout = True 
 
 ' Allow resizing the text box control horizontally and vertically with the form 
 olkCtrl.HorizontalLayout = olHorizontalLayoutGrow 
 olkCtrl.VerticalLayout = olVerticalLayoutGrow 
End Sub

Properties

Name
ControlProperty
EnableAutoLayout
Format
HorizontalLayout
ItemProperty
MinimumHeight
MinimumWidth
PossibleValues
VerticalLayout

See also

Outlook Object Model Reference

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.