RE: Bold Text by AngieM
AngieM
Thu Sep 18 13:49:01 PDT 2008
Worked great, thanks for the expert help.
"Jean-Guy Marcil" wrote:
> "Angie M." wrote:
>
> > Hi,
> >
> > I have the following code:
> >
> > ActiveDocument.Bookmarks("bkRec2").Range.Text = frmAddl.ComboBox2.Text
> > Selection.EndKey Unit:=wdLine
> > Selection.TypeParagraph
> > Selection.Range.Text = frmAddl.txtRec2.Text
> >
> > it works just great. Problem is, I have to BOLD the frmAddl.combobox2.text
> > and nothing else. I've tried all kinds of ways to to this but can't get it
> > to bold, or everything bolds.
>
> Try this:
>
> Dim rgeInsertText As Range
>
> Set rgeInsertText = ActiveDocument.Bookmarks("bkRec2").Range
>
> With rgeInsertText
> .Text = frmAddl.ComboBox2.Text
> .Bold = True
> .Collapse wdCollapseEnd
> .InsertParagraphAfter
> .Collapse wdCollapseEnd
> .Text = frmAddl.txtRec2.Text
> End With
>
>
> Beware of the Selection objrct.
>
> In your code it is not clear whether you want both text to appear one after
> the other.
>
> By using only the range object, it will always be so. In your code,
> sometimes it may not, depending on the cursor location when the code is
> launched.