Format characters in an MS Word table (1 Viewer)

ian_w

Registered User.
Local time
Today, 02:22
Joined
Jun 13, 2006
Messages
64
Hi,

Been struggling with this for a few days so decided I need some assistance :eek:

I have my access database and I am generating a word document based on data in my database, what I need to do is format a certain word in a table cell to be bold - I can't figure this out :/

I am trying to use the .Characters options where I can specify start character and length but I can't work out how to use it!

Can anyone shed any light? Currently the line that write the text looks like this...

Code:
.ActiveDocument.Tables(1).Cell(row, 1).Select
If IsNull(hrec!Parent) Then
.Selection.Text = hrec!RCI_Step & vbCrLf & TrimNull(hrec!TTS_Team) & " To Sign"
Else
.Selection.Text = hrec!Parent & vbCrLf & hrec!RCI_Step & vbCrLf & TrimNull(hrec!TTS_Team) & " To Sign"
End If

What I am trying to do is bold the hrec!Parent data :banghead:

Thanks!
 

Trevor G

Registered User.
Local time
Today, 02:22
Joined
Oct 1, 2009
Messages
2,341
First you can always record a macro in Word to provide the code and then take that code into your VBA in Access. So having recorded a macro in Word to place bold onto some text it records as follows:

PHP:
Sub Macro6()
    Selection.MoveDown Unit:=wdLine, Count:=1
    Selection.MoveRight Unit:=wdCell
    Selection.Font.Bold = wdToggle
End Sub

The part you would use is:

PHP:
Selection.Font.Bold = wdToggle

Which you would apply to hrec!Parent
 

Users who are viewing this thread

Top Bottom