If someone could help, I need the following code changed to late binding.
My database worked great until a 32 bit machine tried to open it. I had the outlook reference set in Access for this to work. I
Currently trying to compare what I have with the following link, but looks like he has extra things in his code I dont use, or I am lacking something for it to work.
http://social.msdn.microsoft.com/Fo...166/switching-to-late-binding?forum=accessdev
Thanks
My database worked great until a 32 bit machine tried to open it. I had the outlook reference set in Access for this to work. I
Currently trying to compare what I have with the following link, but looks like he has extra things in his code I dont use, or I am lacking something for it to work.
http://social.msdn.microsoft.com/Fo...166/switching-to-late-binding?forum=accessdev
Thanks
Code:
Private Sub btnEmail_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Dim RTFBody, strTo
Dim MyApp As New Outlook.Application
Dim MyItem As Outlook.MailItem
'DoCmd.OutputTo acOutputReport, "rptBlotterEntryEmail", acFormatRTF, "rptBlotterEntryEmail"
DoCmd.OutputTo acOutputReport, "rptBlotterEntryEmail", acFormatHTML, "rptBlotterEntryEmail.htm"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("rptBlotterEntryEmail.htm", ForReading)
'Set f = fs.OpenTextFile("rptBlotterEntryEmail", ForReading)
RTFBody = f.ReadAll
f.Close
Set MyItem = MyApp.CreateItem(olMailItem)
With MyItem
.To = "myropctr@HorryCounty.org"
.CC = ""
.Subject = "Police Update"
.HTMLBody = RTFBody
End With
MyItem.Display
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
'If the form data has changed a message is shown asking if
'the changes should be saved. If the answer is no then
'the changes are undone
On Error GoTo BeforeUpdate_Error
If Me.Dirty Then
'if record has been changed the dirty property
' is set to true Display message to save the record
If MsgBox("Record has changed. Save changes?", _
vbYesNo + vbQuestion, "Save Changes") = vbNo Then
Me.Undo
End If
End If
BeforeUpdate_Exit:
Exit Sub
BeforeUpdate_Error:
MsgBox Err.Description
Resume BeforeUpdate_Exit
End Sub