C
Chuck
Here's what I am trying to accomplish to manipulate a
text file. I have a template that opens a Test.txt file
in the same directory and initializes a form that is used
for find / replace functionality. I use the following
code to find a string that exist 4x in Test.txt:
--------------------------------------
Set myRange = ActiveDocument.Range(Start:=0, End:=99)
strtest = ActiveDocument.Range(Start:=0, End:=0)
strtest = Right(myRange, 9)
txtfind.Value = strtest
--------------------------------------------
The above sets the find on the form.
The below code sets the replace on the form:
--------------------------------------------
Dim Order As Variant
txtreplace.Value = System.PrivateProfileString
("C:\Text\Autonumber.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 301000
Else
Order = Order + 1
End If
---------------------------------------------
My cmdclick runs the find replace code, increments the
autonumber in the Autonumber.txt file, and closes the
form. Up to this point, everthing is working as
desired. The problem I am running into is during the
save as Test1.txt. Word is formatting spaces at the end
of Test1.txt, which are not desirable. Any suggestions
would be greatly appreciated.
Thanks,
text file. I have a template that opens a Test.txt file
in the same directory and initializes a form that is used
for find / replace functionality. I use the following
code to find a string that exist 4x in Test.txt:
--------------------------------------
Set myRange = ActiveDocument.Range(Start:=0, End:=99)
strtest = ActiveDocument.Range(Start:=0, End:=0)
strtest = Right(myRange, 9)
txtfind.Value = strtest
--------------------------------------------
The above sets the find on the form.
The below code sets the replace on the form:
--------------------------------------------
Dim Order As Variant
txtreplace.Value = System.PrivateProfileString
("C:\Text\Autonumber.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 301000
Else
Order = Order + 1
End If
---------------------------------------------
My cmdclick runs the find replace code, increments the
autonumber in the Autonumber.txt file, and closes the
form. Up to this point, everthing is working as
desired. The problem I am running into is during the
save as Test1.txt. Word is formatting spaces at the end
of Test1.txt, which are not desirable. Any suggestions
would be greatly appreciated.
Thanks,