【发布时间】:2011-07-05 07:53:13
【问题描述】:
我尝试将格式化文本插入 Word 书签。文本来自几个富文本控件(我们使用 TX 文本控件)并附加到书签中。 问题是标签是按原样编写的,没有被解释。
oWord = New Word.Application
Dim strFileName As String = "\\...\Template.dot"
oDoc = oWord.Documents.Add(strFileName)
Dim strText As String = ""
Dim strOut As String = ""
txtPart1.Save(strOut, TXTextControl.StringStreamType.RichTextFormat)
strText += strOut
strText += ControlChars.CrLf & ControlChars.CrLf & ControlChars.CrLf
strText += txtPart2.Text
oDoc.Bookmarks.Item("Conditions").Range.Text = strText
oWord.Visible = True
我尝试为我的字符串使用 RTF 或 HTML 格式,但行为相同。
【问题讨论】: