A
Alex
I have a Word document in a shared folder.
I want to get a message if any changes have been made in the document.
The code for sending the messages (below) is working fine. But, the user
getting the alert message about enabling or disabling macroses and when the
program is sending the e-mail.
Are there any ways to don't show the user those messages?
I assume that I need something similar to Application.DisplayAlerts =
wdAlertsNone for Outlook but I don't know what it is.
And, how to set up the Security level to Low programmaticaly for a specific
document to avoid macros' alerting?
....
Application.DisplayAlerts = wdAlertsNone
'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
strDoc = ActiveDocument.FullName
'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
'Set the recipient for the new email
.To = "Name"
'Set the recipient for a copy
'Set the subject
.Subject = "changes made in document"
'The content of the document is used as the body for the email
.Body = "Some changes have been made in the document " & strDoc
.Send
End With
....
Thanks
I want to get a message if any changes have been made in the document.
The code for sending the messages (below) is working fine. But, the user
getting the alert message about enabling or disabling macroses and when the
program is sending the e-mail.
Are there any ways to don't show the user those messages?
I assume that I need something similar to Application.DisplayAlerts =
wdAlertsNone for Outlook but I don't know what it is.
And, how to set up the Security level to Low programmaticaly for a specific
document to avoid macros' alerting?
....
Application.DisplayAlerts = wdAlertsNone
'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
strDoc = ActiveDocument.FullName
'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
'Set the recipient for the new email
.To = "Name"
'Set the recipient for a copy
'Set the subject
.Subject = "changes made in document"
'The content of the document is used as the body for the email
.Body = "Some changes have been made in the document " & strDoc
.Send
End With
....
Thanks