模板不能实现,你要先生成报表,然后再用下面的方法设置字体的样式
Dim app As New MSWord.Application
try
Dim doc = app.Documents.Open("d:\test.doc")
Dim gjzs As String = "Test|abc|test"
Dim flag As Boolean = False
For Each gjz As String In gjzs.split("|")
app.ActiveWindow.Selection.WholeStory
With app.ActiveWindow.Selection.Find
.text = gjz
End With
Do While app.ActiveWindow.Selection.Find.Execute
app.ActiveWindow.Selection.Range.HighlightColorIndex = 7
Loop
Next
doc.saved = True
app.Visible = True
catch ex As exception
msgbox(ex.message)
app.Quit
finally
End try