Dear Aspose Team,
when I encountered a problem using aspose would like to ask your help to answer,
I would like to word a paragraph all replaced, and the replacement of a few words into the structured document tag,
but I looked up official file, only to see the need to have the whole structured document tag,
do not know whether we can just put some words into text within a paragraph like the controls, and then ask for your help.
Thank you
P.s1It is my code:
Dim m_strInputDir As String = HttpContext.Current.Server.MapPath("~\Report\Template\AsposeWordTestv1.docx")
Dim m_strOutputDir As String = HttpContext.Current.Server.MapPath("~\Report\AsposeWordTestv1.docx")
'1.get .doc temple
Dim doc As New Document(m_strInputDir)
'2.get Paragraph all node
Dim NodeCollection As NodeCollection = doc.GetChildNodes(NodeType.Paragraph, True)
'3.How can i into PlainText to Paragraph ?
For Each Paragraph As Paragraph In NodeCollection
If Paragraph.Range.Text.Trim.ToString = "[@INSERT_PARA_TEXT]" Then
Paragraph.RemoveAllChildren()
Dim sdtPlainText As New StructuredDocumentTag(doc, SdtType.PlainText, MarkupLevel.Block)
Dim run As New Run(doc)
run.Text = "NTD_________"
run.Font.Color = Color.Green
Paragraph.AppendChild(run)
sdtPlainText.AppendChild(Paragraph)
doc.AppendChild(sdtPlainText)
End If
Next
'Finally.save doc
doc.Save(m_strOutputDir)