Re: Problem with UserForm Initialization by Patrick
Patrick
Sun Apr 15 12:30:29 CDT 2007
Thanks for your help. Here is the final code:
Dim s As String
s = ActiveDocument.Shapes("Text Box 16").TextFrame.TextRange
s = Left(s, Len(s) - 1) ' cut off paragraph mark if you like
If s <> x Then
OptionButton2.Value = True
End If
You also solved another problem I had not begun to address. That was when I
was populating the TextBoxes on my UserForm, I was getting the paragraph
mark:
s = ActiveDocument.Shapes("Text Box 217").TextFrame.TextRange
s = Left(s, Len(s) - 1) ' cut off paragraph mark if you like
TextBox1.Text = s
"Helmut Weber" <nbhymsjxdgcn@mailinator.com> wrote in message
news:3dk323dfpk0ld5ohve5pijdfa0d6u5g15d@4ax.com...
> Hi Patrick,
>
> try
>
> If Selection.Text = "X" & chr(13) Then
>
> Still better not to select anything, like:
>
> Dim s As String
> s = ActiveDocument.Shapes(1).TextFrame.TextRange
> ' shapes(1) is just for my convenience
> s = Left(s, Len(s) - 1) ' cut off paragraph mark if you like
> if s = .................
>
> --
> Greetings from Bavaria, Germany
>
> Helmut Weber, MVP WordVBA
>
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
>
>
>
>
>
>
>