Recent Posts

Wednesday, June 11, 2008

Print output in in file from Vb 6.0 Application

Private Sub PrintOutput(ByVal strData As String)
Dim strPath As String
Dim strExcel As String

Dim strFileName As String

' saving the xml file

strExcel = Trim(lblFileName.Caption)
strExcel = Mid(strExcel, 1, InStr(1, strExcel, ".") - 1)
strFileName = "MerchantNo" & Trim(MDIMain.lblMerchantID.Caption) & strExcel & ".xml"
strPath = App.Path & "\XML\" & strFileName



Dim OutFile As Integer
On Error GoTo SErr:
Dim strTest As String

OutFile = FreeFile
Open strPath For Output As #OutFile
Print #OutFile, strData

Close #OutFile
MsgBox "XML Saved", vbOKOnly
'#############################################################
Exit Sub
SErr:
MsgBox Err.Description

End Sub

Related Posts by Categories




No comments:

Post a Comment