Bolding using Visual Basic`

D

DonnaP.

I have a bookmark that is being used 10 times throughout a document that I
need to have bolded once the user fills in the appropriate text information
in the dialog that I have created. I know it can be done on an individual
basis using the following language:

Dim strSum As String
strSum = fvGetVariableValue("TxtAmount")
With ActiveDocument.Bookmarks("TxtAmount").Range
.Text = strSum
.Bold = True
End With

However, I believe I would need to do this 10 times (changing the txtamount
to txtamount1, txtamount2, etc.) I know there is a way to change a variable
globally throughout a template with the uppercase:

Dim strReleasorName As String
strReleasorName = fvGetVariableValue("TxtReleasor_Name")
If Len(strReleasorName) > 0 Then
strReleasorName = UCase$(strReleasorName)
sbSetVariableValue "TxtReleasor_Name", strReleasorName
End If

Is there a way to do the same thing for bolding the text string?
 
G

Greg Maxey

Donna,

When you say used 10 times then to you mean the data at your bookmark
range is being repeated using REF fields located at 10 different
locations?

If yes, then just use the \* CharFormat switch in the fields.

{ REF TxtAmount \* CharFormat } and bold the lette "R" in the field
code.
 
D

DonnaP.

Hi, Greg,

Thanks for responding so quickly. I'm actually using a third party program
called Innova which allows me to create dialogs and templates within Word
(the text boxes on the dialogs being the bookmarks within the template). The
program then utilizes a .dot file which allows me to add VB coding to their
bookmarks, checkboxes, etc. Within VB I was able to add the code
strReleasorName = UCase$(strReleasorName) and then set the variable to make a
bookmark upper case throughout the template but couldn't find the same sort
of VB language for being able to do it for bolding.
 

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

Top