NotesStream vs Write Statement

Hello all - In my script below I am getting doubl qoutes at the begining and End of each line of my text file. How can I remove them?

Also, should I be using NotesStream to accomplish the same output which I am getting from my script below?

Sub Initialize

Dim Session As NotesSession     

Dim db As NotesDatabase

Dim view As NotesView

Dim doc As NotesDocument

Dim fileNum As Integer, I As Integer

Dim fileName As String	

Dim xxAppointmentType As Variant

Dim TaskType As Variant	

Dim xxLocation As Variant		

Dim nam As NotesName

Dim xxChair As Variant

Dim xxRoom As Variant 

Dim xxSubject As Variant

Dim ExpValue As String

Dim CalEntry As String



Set Session =  New NotesSession

Set db = session.CurrentDatabase

Set View = db.GetView("($Calendar)")

Set doc = view.GetFirstDocument



' Get an unused file number so LotusScript can open a file.

fileNum% = Freefile()

’ fileName$ = "C:\tmp" & doc.UniversalID & “.txt”

fileName$ = "C:\tmp\" & Format(Now(), "mmddyyyy")  & Format(Time(), "hhmmss") &".txt"	

’ Write out some employee data.

Open fileName$ For Output As fileNum%



Do While Not(doc Is Nothing)

	TaskType = doc.getItemValue("TaskType")

	Set nam = New NotesName(doc.Chair(0)) 		

	xxAppointmentType = doc.AppointmentType(0)

	xxRoom = doc.Room(0)

	xxChair= nam.Common

	xxSubject = doc.Subject(0)

	

	If xxAppointmentType<>"3" Then		

		Goto flag

	Else

		xxRoom = "Room: " & doc.Room(0)        

	End If

	

	If xxAppointmentType = "3" Then

		xxChair = "Chair: " & xxChair  

	Elseif TaskType = "2" Then

		xxChair = "Owner: " & xxChair  

	End If

flag:

	If Not Isnull(doc.Location) Then

		xxLocation = "Location: " & doc.Location(0)

	Else

		xxLocation = ""

	End If

	

	CalEntry = xxSubject & "~" &  xxRoom & "~" &  xxLocation & "~" &  xxChair

	'Messagebox (CalEntry)

	

	ExpValue = doc.StartDateTime(0) & "~" & doc.EndDateTime(0) & "~" & CalEntry

	

	'Messagebox (ExpValue)

	

	Write #fileNum%, ExpValue

	Set doc = view.GetNextDocument(doc)

Loop

Close fileNum%

End Sub

Subject: Have a look at the Print # statement in the Designer Help

Subject: RE: Have a look at the Print # statement in the Designer Help

Thanks James, I saw that and changed the code from a write to a print statement.