Hi, I have so far the following code, being executed in a
for/next-loop:

Set oRange = objWordDoc.Range
oRange.InsertAfter "some text"
oRange.InsertAfter vbcrlf
oRange.InsertAfter vbtab & "again text" & vbcrlf

my question:
How can I set "some text" to appear in bold in the
document? (I'm using VB6 to create word documents)

Many thanks,
O.B.1.

Insert bold text after range by Dave

Dave
Fri Dec 05 07:23:34 CST 2003

Hi,

You can modify your range object like the following:

With oRange
.InsertAfter "some text"
.Font.Bold = True
.InsertAfter vbCrLf
.InsertAfter vbTab & "again text" & vbCrLf
End With

HTH, Dave


>-----Original Message-----
>Hi, I have so far the following code, being executed in
a
>for/next-loop:
>
>Set oRange = objWordDoc.Range
>oRange.InsertAfter "some text"
>oRange.InsertAfter vbcrlf
>oRange.InsertAfter vbtab & "again text" & vbcrlf
>
>my question:
>How can I set "some text" to appear in bold in the
>document? (I'm using VB6 to create word documents)
>
>Many thanks,
>O.B.1.
>.
>

Insert bold text after range by anonymous

anonymous
Mon Dec 08 04:15:11 CST 2003

I've tried this, but this approach puts the whole text in
bold, which in the purpose. Only the appended text should
appear in bold. Thx anyway!

>-----Original Message-----
>Hi,
>
>You can modify your range object like the following:
>
>With oRange
> .InsertAfter "some text"
> .Font.Bold = True
> .InsertAfter vbCrLf
> .InsertAfter vbTab & "again text" & vbCrLf
>End With
>
>HTH, Dave
>
>
>>-----Original Message-----
>>Hi, I have so far the following code, being executed in
>a
>>for/next-loop:
>>
>>Set oRange = objWordDoc.Range
>>oRange.InsertAfter "some text"
>>oRange.InsertAfter vbcrlf
>>oRange.InsertAfter vbtab & "again text" & vbcrlf
>>
>>my question:
>>How can I set "some text" to appear in bold in the
>>document? (I'm using VB6 to create word documents)
>>
>>Many thanks,
>>O.B.1.
>>.
>>
>.
>

Re: Insert bold text after range by Jonathan

Jonathan
Mon Dec 08 05:59:39 CST 2003

Hi O.B.1

Modify Dave's code as follows. I've added an extra line near the start

With oRange
.Collapse Direction:=0
.InsertAfter "some text"
.Font.Bold = True
.InsertAfter vbCrLf
.InsertAfter vbTab & "again text" & vbCrLf
End With

--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup


<anonymous@discussions.microsoft.com> wrote in message
news:026801c3bd74$29e5d510$a001280a@phx.gbl...
> I've tried this, but this approach puts the whole text in
> bold, which in the purpose. Only the appended text should
> appear in bold. Thx anyway!
>
> >-----Original Message-----
> >Hi,
> >
> >You can modify your range object like the following:
> >
> >With oRange
> > .InsertAfter "some text"
> > .Font.Bold = True
> > .InsertAfter vbCrLf
> > .InsertAfter vbTab & "again text" & vbCrLf
> >End With
> >
> >HTH, Dave
> >
> >
> >>-----Original Message-----
> >>Hi, I have so far the following code, being executed in
> >a
> >>for/next-loop:
> >>
> >>Set oRange = objWordDoc.Range
> >>oRange.InsertAfter "some text"
> >>oRange.InsertAfter vbcrlf
> >>oRange.InsertAfter vbtab & "again text" & vbcrlf
> >>
> >>my question:
> >>How can I set "some text" to appear in bold in the
> >>document? (I'm using VB6 to create word documents)
> >>
> >>Many thanks,
> >>O.B.1.
> >>.
> >>
> >.
> >