G
Gina Meyer
Hi all.
I am trying to write a string in binary mode so that when looking at the
file a human cannot read it ....
(is this the correct way at all to make it only machine readable ?)
Below is my function and it works fine when using 'For Output As #intFile'
..... when I use the two lines (***) together I get an error ....
where am I going wrong ?
Many thanks for your help!!
Gina
Public Function WriteComText(strVal As String)
Dim locComm as String
Dim f As Object
Dim bFileExists As Boolean
Dim intFile As Integer
intFile = FreeFile()
Set f = CreateObject("Scripting.FileSystemObject")
locComm = CurrentProject.Path & "\" & "Files"
bFileExists = f.FileExists(locComm & "\" & LCase("Commercial.txt"))
If bFileExists Then
Open locComm & "\" & LCase("Commercial.txt") For Output As #intFile
'Open locComm & "\" & LCase("Commercial.txt") For Binary Access
Write As #intFile 1***
If strVal <> "" Then
Print #intFile, strVal 2***
End If
Close #intFile
End If
End Function
I am trying to write a string in binary mode so that when looking at the
file a human cannot read it ....
(is this the correct way at all to make it only machine readable ?)
Below is my function and it works fine when using 'For Output As #intFile'
..... when I use the two lines (***) together I get an error ....
where am I going wrong ?
Many thanks for your help!!
Gina
Public Function WriteComText(strVal As String)
Dim locComm as String
Dim f As Object
Dim bFileExists As Boolean
Dim intFile As Integer
intFile = FreeFile()
Set f = CreateObject("Scripting.FileSystemObject")
locComm = CurrentProject.Path & "\" & "Files"
bFileExists = f.FileExists(locComm & "\" & LCase("Commercial.txt"))
If bFileExists Then
Open locComm & "\" & LCase("Commercial.txt") For Output As #intFile
'Open locComm & "\" & LCase("Commercial.txt") For Binary Access
Write As #intFile 1***
If strVal <> "" Then
Print #intFile, strVal 2***
End If
Close #intFile
End If
End Function