Sizing a Form Control
- From: "Greg Maxey" <gmaxey@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 29 Aug 2007 07:30:47 -0400
I have a control toolbox command button in a protected form. When inserted
the height property is 24 and the width property is 72. The control is
formatted as a floating shape.
When I run the following code the control is not visible in the form:
Sub HideResetCommand()
Dim oCtr
Set oCtr = ActiveDocument.Shapes(1)
oCtr.OLEFormat.Object.Caption = ""
oCtr.OLEFormat.Object.Width = 0
oCtr.OLEFormat.Object.Height = 0
End Sub
The following code makes the control visible again in the form:
Sub ShowResetCommand()
Dim oCtr
Set oCtr = ActiveDocument.Shapes(1)
oCtr.OLEFormat.Object.Caption = "Reset Form"
oCtr.OLEFormat.Object.LockAspectRation = False
oCtr.OLEFormat.Object.Height = 24
oCtr.OLEFormat.Object.Width = 72
End Sub
Here is the proble. The control appears 72 picas high and 72 picas wide.
If I change the order of the height and width commands above then the
control appears as 24 picas high and 24 picas wide.
There is no intellisense with the .Object so I am at a loss as to what
command line I need.
Thanks.
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
.
- Follow-Ups:
- Re: Sizing a Form Control
- From: Helmut Weber
- Re: Sizing a Form Control
- From: Christian Freßdorf
- Re: Sizing a Form Control
- From: Mo
- Re: Sizing a Form Control
- Prev by Date: Need help: Commandbar event
- Next by Date: Re: Sizing a Form Control
- Previous by thread: Need help: Commandbar event
- Next by thread: Re: Sizing a Form Control
- Index(es):