Snookless7
Technical User
Hello,
I have been reading previous post regarding automatic email notifications when the document has been changed/saved.
I have tried almost every code I have seen, however I am not that accustomed to VB.
How I enter the scrips is just click on the VB Icon and paste the script in, altering the email of course then saving.
I have tried multiple scripts and this is the one I am using now but yet I get no email after I save??
I know the problem is me...doing something wrong as usual.....but i can not figure this one out.
Using MS Excel Pro Plus 10
Thank you in advance.
I have been reading previous post regarding automatic email notifications when the document has been changed/saved.
I have tried almost every code I have seen, however I am not that accustomed to VB.
How I enter the scrips is just click on the VB Icon and paste the script in, altering the email of course then saving.
I have tried multiple scripts and this is the one I am using now but yet I get no email after I save??
Code:
Sub SendNotif()
Dim bStarted As Boolean
Dim oOutlookApp As Object
Dim oItem As Object
On Error Resume Next
'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
'Outlook wasn't running, start it from code
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(0)
With oItem
'Set the recipient for the new email
.To = "QAAlert@test.com"
'Set the subject
.Subject = "QUALITY ALERT!!!!"
'Set the message body
.Body = "The Reject Log has been updated. Please Check!"
.Send
End With
If bStarted Then
'If we started Outlook from code, then close it
oOutlookApp.Quit
End If
'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub
I know the problem is me...doing something wrong as usual.....but i can not figure this one out.
Using MS Excel Pro Plus 10
Thank you in advance.