Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

append a file after finding a string in VB

Status
Not open for further replies.

pujas

Programmer
Feb 2, 2005
22
0
0
US
Hi,

I want to append a line into a file after i find this string " </title>" in the file.
Any ptrs will greatly be appreciated.

Also can someone tell me how do i escape " in a string
I want to store a string with " in it
eg

Dim strRet As String
strRet = "<A HREF="XYZ/Main.txt">ABC</A>"

i tried
strRet = "<A HREF=\"XYZ/Main.txt\">ABC</A>"
but it did not work

Thanks
 
As this is a VBA forum, are you talking about appending a line into a Word file?

You can use Chr(34), as in:
strRet = "<A HREF=" & Chr(34) & "XYZ/Main.txt" & _
Chr(34) & ">ABC</A>"



Gerry
 
You may also use this syntax:
strRet = "<A HREF=""XYZ/Main.txt"">ABC</A>"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top