MS Access VBA - how to bold text?

K

Keith G Hicks

Word 2003
Access 2003

I'm creating the body of a document from a dot file. I need to bold a
sentence that comes between 2 others.


Set docWord = objWord.Documents.Add(Template:=sWordFormsPath & "LetRec.dot")

Dim rngWord As Word.Range

Set rngWord = docWord.Goto(What:=wdGoToBookmark, Name:="LetterBody")

rngWord.InsertAfter "We have enclosed a signed and notarized authorization
that allows us to receive this inforrmation on behalf of our client. "

rngWord.InsertAfter "If you would prefer payment in advance, kindly advise
and we shall remit same immediately. "

rngWord.InsertAfter "Thank you for your anticipated cooperation."


I've tried a few things that don't seem to work. What code do I need to bold
that middle sentence?

Thanks,

Keith
 
K

Keith G Hicks

Here's the answer if anyone's interested:

with rngWord
.Collapse wdCollapseEnd
.InsertAfter "If you would prefer payment in advance, kindly..."
.Font.Bold = True
.Collapse wdCollapseEnd
.InsertAfter "Thank you for your anticipated cooperation."
.Font.Bold = False
end with
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top