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

Writing to a file w/o quotes 1

Status
Not open for further replies.

RichS

Programmer
Apr 24, 2000
380
US
How do you write to a file so that each line does not have a beginning and ending quote?
What I have is:

' Open the file
Open "C:\VBFormControls\" & Me.Name & "_Controls.txt" For Output As #1

' Include all the Control types to add ToolTips to
For Each ctl In Controls
If (TypeOf ctl Is TextBox) Or _
(TypeOf ctl Is ComboBox) Or _
(TypeOf ctl Is ListBox) Or _
(TypeOf ctl Is VSFlexGrid) Or _
(TypeOf ctl Is ListView) _
Then
sLine = ctl.Name & ".ToolTip = """
Write #1, sLine

End If
Next

Close #1



In the file I get "Some text" rather that just:

Some text
 
Thanks!! I could not for the live of me remember how to do that. I new it was something simple. (Hate it when that happens.)

Rich
 
You might also consider using the Scripting runtime (scrrun.dll) instead. You can use the FileSystemObject and TextStream objects to read/write lines and they don't have quotes...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top