Я запускаю командную строку в Windows и получаю предупреждение на 24-й строке и 34-м символе
Пример кода:
Sub CatchMe()
Dim outobj, mailobj
Dim strFileText
Dim objFileToRead
Set outobj = CreateObject("Outlook.Application")
Set mailobj = outobj.CreateItem(0)
strFileText = GetText("C:\Users\Yatheesh.Sathyanaray.STDC\Documents1.txt")
With mailobj
.To = "yatheesh.satyanarayana@stratogent.com"
.Subject = "Testmail"
.Body = strFileText
.Display
End With
'Clear the memory
Set outobj = Nothing
Set mailobj = Nothing
End Sub
Function GetText(sFile As String) As String
Dim nSourceFile As Integer, sText As String
nSourceFile = FreeFile
'Write the entire file to sText
Open sFile For Input As #nSourceFile
sText = Input$(LOF(1), 1)
Close
GetText = sText
End Function