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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

questions regarding quotes, html tags, and text variables

Status
Not open for further replies.

mettodog

Vendor
Jul 11, 2000
94
US
first question: i want to say Print, &quot;<A href=&quot; Search</a>
i always get errors, or vb inserts ; into various places because of the &quot;&quot; around the link. how do i get that text to print AND include the quotes as i have them written by the Print command.

#2
will vb give errors because of the html tags?

#3
how can i use variables within the print command?
ex. i want to write <a href=&quot;variableurl&quot;VariableTitle</a>
but i think that when i do that, it wont insert the variable itself it will just print the variable name as text.

any comments/suggestions/answers are greatly appreciated.
 
1. To get around the double quotes problem, use the Chr() keyword:

Instead of:
Print #1, &quot;<A href=&quot; Search</a>&quot;

use:
Print #1, &quot;<A href=&quot; & Chr(34) & &quot; Chr(34) & &quot;>Google Search</a>&quot;

2. No - you are just printing out a text string.

3. Use:

Dim sURL As String
Dim sLinkTitle As String

sURL = &quot;sLinkTitle = &quot;Google Search&quot;
Open &quot;C:\aa\aa.txt&quot; For Append As #1
Print #1, &quot;<A href=&quot; & Chr(34) & sURL & Chr(34) & &quot;>&quot; & sLinkTitle & &quot;</a>&quot;
Close #1


Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top