B
Bragu
We have a problem: if we have setted the option to spell the mail before
sending the outlook, sometimes, crash and we lose the mail.
I want to write a macro that save the mail before sending, so if the
application crash we don't lose the mail.
But the event send of MailItem is rised after the spelling it's runned.
Is there any way to save it before the spelling start ?
I wrote a macro (copy from explamples on internet) that work we commandbars
button (see Sub SaveSpellSend attached ) but it's not a nice way because if
somebody stop the spell checking the mail will be sended anyway.
Thank's for any help ... and sorry for my english
ps: Our system are w2k/ xp with office 2000 SR1 multilanguage pack with all
the last fix installed.
Sub SaveSpellSend()
Dim objApp As Outlook.Application
Dim objInspector As Outlook.Inspector
Dim objItem As MailItem
Dim strRecipName As String
Dim flgErr As Integer
flgErr = 0
On Error GoTo errHandler
Set objApp = CreateObject("Outlook.Application")
Set objInspector = objApp.ActiveInspector
If Not TypeName(objInspector) = "Nothing" Then
Set objItem = objInspector.CurrentItem
If objItem.Class = olMail And _
objItem.Sent = False Then
objItem.Save
flgErr = 1
If CheckSpelling Then
objItem.Send
Else
MsgBox "Per poter eseguire il controllo ortografico il cursore
deve trovarsi nel body", vbExclamation
End If
End If
End If
Set objItem = Nothing
Set objInspector = Nothing
Set objApp = Nothing
Exit Sub
errHandler:
Select Case flgErr
Case 1:
MsgBox "Il messaggio è stato salvato ma non è stato possibile
eseguire il controllo ortografico", vbInformation, "Check Mail"
Case 287:
MsgBox "Mail non spedito come da vostra scelta.", vbInformation,
"Check Mail"
Case Else
MsgBox "Errore : " & "(" & Err.Number & ")" & vbCrLf &
Err.Description, vbCritical, "Errore nel controllo/invio mail"
End Select
End Sub
sending the outlook, sometimes, crash and we lose the mail.
I want to write a macro that save the mail before sending, so if the
application crash we don't lose the mail.
But the event send of MailItem is rised after the spelling it's runned.
Is there any way to save it before the spelling start ?
I wrote a macro (copy from explamples on internet) that work we commandbars
button (see Sub SaveSpellSend attached ) but it's not a nice way because if
somebody stop the spell checking the mail will be sended anyway.
Thank's for any help ... and sorry for my english
ps: Our system are w2k/ xp with office 2000 SR1 multilanguage pack with all
the last fix installed.
Sub SaveSpellSend()
Dim objApp As Outlook.Application
Dim objInspector As Outlook.Inspector
Dim objItem As MailItem
Dim strRecipName As String
Dim flgErr As Integer
flgErr = 0
On Error GoTo errHandler
Set objApp = CreateObject("Outlook.Application")
Set objInspector = objApp.ActiveInspector
If Not TypeName(objInspector) = "Nothing" Then
Set objItem = objInspector.CurrentItem
If objItem.Class = olMail And _
objItem.Sent = False Then
objItem.Save
flgErr = 1
If CheckSpelling Then
objItem.Send
Else
MsgBox "Per poter eseguire il controllo ortografico il cursore
deve trovarsi nel body", vbExclamation
End If
End If
End If
Set objItem = Nothing
Set objInspector = Nothing
Set objApp = Nothing
Exit Sub
errHandler:
Select Case flgErr
Case 1:
MsgBox "Il messaggio è stato salvato ma non è stato possibile
eseguire il controllo ortografico", vbInformation, "Check Mail"
Case 287:
MsgBox "Mail non spedito come da vostra scelta.", vbInformation,
"Check Mail"
Case Else
MsgBox "Errore : " & "(" & Err.Number & ")" & vbCrLf &
Err.Description, vbCritical, "Errore nel controllo/invio mail"
End Select
End Sub