仅格式化一行vb6 word 2007条形码

仅格式化一行vb6 word 2007条形码,vb6,ms-word,automation,format,Vb6,Ms Word,Automation,Format,我正在使用vb6通过一个表自动化word文档。我有以下资料: strCellContents = "s " & CStr(oRec("sphBase")) & " c " & CStr(oRec("cylAdd")) & vbCrLf strCellContents = strCellContents & oRec("Description") & vbCrLf strCellContents = strCellContents &

我正在使用vb6通过一个表自动化word文档。我有以下资料:

strCellContents = "s " & CStr(oRec("sphBase")) & "     c " & CStr(oRec("cylAdd")) & vbCrLf
strCellContents = strCellContents & oRec("Description") & vbCrLf
strCellContents = strCellContents & "1010" & CStr(oRec("RightOPC")) & vbCrLf
strCellContents = strCellContents & "1010" & CStr(oRec("RightOPC")) & vbCrLf
oDoc.Tables(1).Range.ParagraphFormat.SpaceBefore = 6
oDoc.Tables(1).Range.ParagraphFormat.SpaceAfter = 0
oDoc.Tables(1).Range.ParagraphFormat.LineSpacing = InchesToPoints(0.11)
oDoc.Tables(1).Cell(row, col).Range.Text = strCellContents
If Not oRec.EOF Then
    oRec.MoveNext
End If
你会注意到我将其中一行重复了两次,在30个单元格(3列10行)中的每一行给我四行文本。我希望重复行的第一个实例具有条形码字体。我该如何格式化这一行呢?我已经安装了条形码字体。

我找到了答案 iNumWords=oDoc.Tables(1).Range.Words.Count ''修改条形码字体(第三行)-现在加下划线 对于q=1到iNumWords 如果CStr(oDoc.表(1).范围.字(q))=strSKU,则
oDoc.Tables(1).Range.Words(q).Font.Underline=wdUnderlineSingle 退出 如果结束 下一个