I need a litle help here.
I am creating a program that finds a specific sentence in a word path and replaces it with a given value.
Specific sentence: l="600"
And it has to be changed to : l="300"
This is not to dificult and works fine:
Public Class Form1
Private Property sign As String Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim sign1 As String Dim sign2 As String sign1 = ("""600""") 'sign1 = ("""") sign2 = ("""300""") Dim source As String = "C:\temp\bodem.mpr" 'path from original file Dim destination As String = "C:\temp\bodem2.mpr" 'path new file Dim oldText As String = "l=" & sign1 'old value Dim newText As String = "l=" & sign2 'new value My.Computer.FileSystem.WriteAllText(destination, My.Computer.FileSystem.ReadAllText(source).Replace(oldText, newText), False) Process.Start("C:\temp\bodem2.mpr") 'opens program in wordpath to control value End Sub
The only problem is that the originnal sentence : l="600" does not always have the value 600, but instead always has a different vallue that i dont know. how can i write this down in my code.
Thanks in advance!