Yes it is:
Sub SendPollingPlaceChangeFormAsAttachment()
'
' PollingPlaceChangeForm Macro
' Macro created 9/28/2005 by Aaron Neunz
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then
MsgBox "Document needs to be saved first"
Exit Sub
End If
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.To = "
[email protected]"
.Subject = "A POLLING LOCATION HAS BEEN CHANGED"
'Add the document as an attachment, you can use the .displayname
property
'to set the description that's used in the message
.Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue,
_ DisplayName:="Document as Attachment"
.Send
End With
If bStarted Then
oOutlookApp.Quit
End If
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub
Also, say I create a new document from my template project. I save
this Word document with a filename and send it via email to another
user. I do not want them to have the ability to click on the macro
toolbar button referencing this code. How can I remove the reference
to the template in the new document?
Thanks