I'm trying to add a html file data to the .HTMLBody.
I'm using a function to read the file data
.HTMLBody = GetFileData(PathOfFile)
Well, it adds my signature and all the formatting but characters like ć, č, š... mess up. Also, it doesn't add the image I have in the html file but the characters are priority now.
I'm writing from my phone, sorry I couldn't be more specific.
Thanks!
Edit:
The function which I use to read the file content. When I print it in the debug windows, the GetTextFileContents the weird characters are there.
So I suppose Set ts = fso.GetFile(sFilePath).OpenAsTextStream(1, -2) this line is where it messes up the text. But the -2 is for system default which shouldnt make problems then?
I'm using a function to read the file data
.HTMLBody = GetFileData(PathOfFile)
Well, it adds my signature and all the formatting but characters like ć, č, š... mess up. Also, it doesn't add the image I have in the html file but the characters are priority now.
I'm writing from my phone, sorry I couldn't be more specific.
Thanks!
Edit:
Code:
Public Function GetTextFileContents(sFilePath As String) As String
If Dir(sFilePath) <> "" Then
Dim fso As Object
Dim ts As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(sFilePath).OpenAsTextStream(1, -2)
GetTextFileContents = ts.ReadAll
ts.Close
Set ts = Nothing
Set fso = Nothing
End If
End Function
The function which I use to read the file content. When I print it in the debug windows, the GetTextFileContents the weird characters are there.
So I suppose Set ts = fso.GetFile(sFilePath).OpenAsTextStream(1, -2) this line is where it messes up the text. But the -2 is for system default which shouldnt make problems then?
Last edited: