1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Dim result As DialogResult
result = MessageBox.Show("Dou you want to proceed with your modification to company name", tabl(3), MessageBoxButtons.YesNo)
If result = Windows.Forms.DialogResult.No Then
Dim doc As New WordDocument("c:\doc\test_newdb2.docx")
Dim source1 As String = ""
Dim text1 As String = doc.ToText()
Dim separator1 As String() = New String() {vbCr & vbLf}
Dim splittedText As String() = text1.Split(separator1, StringSplitOptions.RemoveEmptyEntries)
For z As Integer = 0 To splittedText.Length - 1
If splittedText(z).IndexOf("Source*:") > -1 Then 'je cherche la valeur après "Source*:" pour la modifier
source1 = splittedText(z).Substring(9)
source1.ToString.Replace(source1, source) ' source est la valeur initiale
End If
Next
End If |
Partager