Hello
I would like to have Paragraph(s) in the word table cell formatted as below:
In table I would have below text
Experience : --> this has to be bold
1> Experience comprises of company name, position hold, start and end date --> one string which would cover this -->this should be bold, the data comes from database query.
2 >Experience in detail --> from query memo field. --> this should be non bold format.
THe above point 1 and 2 could repeat based on recordset result found given criteria.
and this is within table cell for example cell (8,1).
Can anyone help me on this how to achive using this ??
Below is the code i tried but it does the require things but after operation it makes all the cell text to BOLD which I dont want...
Please
I would like to have Paragraph(s) in the word table cell formatted as below:
In table I would have below text
Experience : --> this has to be bold
1> Experience comprises of company name, position hold, start and end date --> one string which would cover this -->this should be bold, the data comes from database query.
2 >Experience in detail --> from query memo field. --> this should be non bold format.
THe above point 1 and 2 could repeat based on recordset result found given criteria.
and this is within table cell for example cell (8,1).
Can anyone help me on this how to achive using this ??
Below is the code i tried but it does the require things but after operation it makes all the cell text to BOLD which I dont want...
Code:
With ActiveDocument.Tables(1).Cell(7, 1).Range
.Font.Name = "Calibri (Body)"
.Font.Size = 12
.Font.Bold = True
' .Font.Underline = True
.Text = "Experience" & vbCrLf & vbCrLf
End With
Dim composite As String
If rsGetExp.RecordCount <> 0 Then
While Not rsGetExp.EOF
composite = rsGetExp.Fields("Company Name").Value & ", " & rsGetExp.Fields("Position Held").Value & ", " & rsGetExp.Fields("Start Date").Value & " to " & rsGetExp.Fields("End Date").Value & vbCrLf
'Select the whole cell
ActiveDocument.Tables(1).Cell(7, 1).Select
'Move to the right
Selection.Collapse Direction:=wdCollapseEnd
'Move back to the left
Selection.MoveLeft wdCharacter, 1
'Add the text (using the myText1 format)
Selection.Range.Text = composite
'Select the on word the right (myText2)
Selection.MoveRight Unit:=wdCharacter, Count:=Len(rsGetExp.Fields("Company Name").Value & ", " & rsGetExp.Fields("Position Held").Value & ", " & rsGetExp.Fields("Start Date").Value & " to " & rsGetExp.Fields("End Date").Value), Extend:=wdMove
'Format myText2
Selection.Range.Font.Underline = False
Selection.Range.Font.Bold = True
Selection.Range.Font.Size = 12
' Selection.Collapse Direction:=wdCollapseEnd
If rsGetExp.Fields("Experience in detail").Value <> "" Then
ActiveDocument.Tables(1).Cell(7, 1).Select
Selection.Collapse Direction:=wdCollapseEnd
' Move back to the left
Selection.MoveLeft wdCharacter, 1
'Add the text (using the myText1 format) &
Selection.Range.Text = rsGetExp.Fields("Experience in detail").Value & vbCrLf & vbCrLf
Selection.MoveDown Unit:=wdParagraph, Count:=Trim(Len(rsGetExp.Fields("Experience in detail").Value)), Extend:=wdExtend
Selection.Range.Font.Underline = False
Selection.Range.Font.Bold = False
Selection.Range.Font.Size = 12
End If
rsGetExp.MoveNext
Wend
Please
Last edited: