C
Curtis Stevens
I click a button and suppose to open an email. The body it is suppose to use
is HTML and is suppose to get the content from a file located on my pc.
Me.PDFEmailCreator is the name of the unbound pull down I'm using, to obtain
the name of the file to use.
Here is my code. It isn't working, anyone know why?
Dim objOApp As Object
Dim objOMessage As Object
Dim txtDir As String
Dim fso As Object
Dim ts As Object
Const olMailItem = 0
txtDir = "C:\Documents and Settings\Curtis
Stevens\Desktop\Applications\USMS\Emails\"
Set objOApp = CreateObject("Outlook.Application") 'created the
application here
Set objOMessage = objOApp.CreateItem(olMailItem) ' and last here is
an Mail Item
Set fso = CreateObject("Scripting.FileSystemObject")
'if Me.PDFEmailCreator is the file which you hold the email content
Set ts = fspenTextFile(txtDir & Me.PDFEmailCreator, spForReading)
txtbody = txtDir & Me.PDFEmailCreator
With objOMessage
.to = Me.BizEmail
.Subject = "Application"
.htmlbody = ts.ReadAll 'read all content of file
Me.PDFEmailCreator
.Display
End With
Thanks!!
Curtis
is HTML and is suppose to get the content from a file located on my pc.
Me.PDFEmailCreator is the name of the unbound pull down I'm using, to obtain
the name of the file to use.
Here is my code. It isn't working, anyone know why?
Dim objOApp As Object
Dim objOMessage As Object
Dim txtDir As String
Dim fso As Object
Dim ts As Object
Const olMailItem = 0
txtDir = "C:\Documents and Settings\Curtis
Stevens\Desktop\Applications\USMS\Emails\"
Set objOApp = CreateObject("Outlook.Application") 'created the
application here
Set objOMessage = objOApp.CreateItem(olMailItem) ' and last here is
an Mail Item
Set fso = CreateObject("Scripting.FileSystemObject")
'if Me.PDFEmailCreator is the file which you hold the email content
Set ts = fspenTextFile(txtDir & Me.PDFEmailCreator, spForReading)
txtbody = txtDir & Me.PDFEmailCreator
With objOMessage
.to = Me.BizEmail
.Subject = "Application"
.htmlbody = ts.ReadAll 'read all content of file
Me.PDFEmailCreator
.Display
End With
Thanks!!
Curtis