hortizjr59
Registered User.
- Local time
- Today, 03:42
- Joined
- Sep 6, 2011
- Messages
- 30
I tried using this code with a few mods in my database but keep getting a compiler syntax error:
I am using the code as follows:
Private Sub Command135_Click()
Dim strline, strHTML
Dim OL As Outlook.Application
Dim MyItem As Outlook.MailItem
Set OL = New Outlook.Application
Set MyItem = Outlook.Application.CreateItem(olMailItem)
strWhere = "[Improvement No] = " & Me.[Improvement No]
DoCmd.OutputTo acOutputReport, "ReportEmailNoticeofAssigned", acFormatHTML,
"C:\Documents and Settings\hortiz\My Documents\Hector\myreport.html"
Open "C:\Documents and Settings\hortiz\My Documents\Hector\myreport.html" For Input As 1
Do While Not EOF(1)
Input #1, strline
strHTML = strHTML & strline
Loop
Close 1
' If OL2002 set the BodyFormat
If Left(OL.Version, 2) = "10" Then
MyItem.BodyFormat = olFormatHTML
End If
MyItem.HTMLBody = strHTML
MyItem.Display
End Sub
I am using the code as follows:
Private Sub Command135_Click()
Dim strline, strHTML
Dim OL As Outlook.Application
Dim MyItem As Outlook.MailItem
Set OL = New Outlook.Application
Set MyItem = Outlook.Application.CreateItem(olMailItem)
strWhere = "[Improvement No] = " & Me.[Improvement No]
DoCmd.OutputTo acOutputReport, "ReportEmailNoticeofAssigned", acFormatHTML,
"C:\Documents and Settings\hortiz\My Documents\Hector\myreport.html"
Open "C:\Documents and Settings\hortiz\My Documents\Hector\myreport.html" For Input As 1
Do While Not EOF(1)
Input #1, strline
strHTML = strHTML & strline
Loop
Close 1
' If OL2002 set the BodyFormat
If Left(OL.Version, 2) = "10" Then
MyItem.BodyFormat = olFormatHTML
End If
MyItem.HTMLBody = strHTML
MyItem.Display
End Sub