Hello,
I was wondering if there is a way in VBA to take a string set it as
the text in a label for a userform rather than use the IDE to enter it
through the properties window. To be more specific, I am reading cells
from a Word Table and storing them as strings, then the user gets a
list of the cells contents in the userform presented as labels next to
checkboxes. Thanks in advance for any help you can send my way.

Rob

Re: Take a sting and set it as text in a userform label by Greg

Greg
Mon Jul 10 10:50:23 CDT 2006

Rob,

You could use the UserForm Initialize event and set the value of the
label caption to a table cell text. E.g.,

Private Sub UserForm_Initialize()
Me.Label1.Caption = ActiveDocument.Tables(1).Cell(1, 1).Range.Text
End Sub

RoVo wrote:
> Hello,
> I was wondering if there is a way in VBA to take a string set it as
> the text in a label for a userform rather than use the IDE to enter it
> through the properties window. To be more specific, I am reading cells
> from a Word Table and storing them as strings, then the user gets a
> list of the cells contents in the userform presented as labels next to
> checkboxes. Thanks in advance for any help you can send my way.
>
> Rob


Re: Take a sting and set it as text in a userform label by RoVo

RoVo
Mon Jul 10 11:07:20 CDT 2006

Greg,
Thanks alot, its working perfectly, your the man.

Rob
Greg Maxey wrote:
> Rob,
>
> You could use the UserForm Initialize event and set the value of the
> label caption to a table cell text. E.g.,
>
> Private Sub UserForm_Initialize()
> Me.Label1.Caption = ActiveDocument.Tables(1).Cell(1, 1).Range.Text
> End Sub
>
> RoVo wrote:
> > Hello,
> > I was wondering if there is a way in VBA to take a string set it as
> > the text in a label for a userform rather than use the IDE to enter it
> > through the properties window. To be more specific, I am reading cells
> > from a Word Table and storing them as strings, then the user gets a
> > list of the cells contents in the userform presented as labels next to
> > checkboxes. Thanks in advance for any help you can send my way.
> >
> > Rob