M
Mangus Pyke
I'm send an identical email with a different attachment to eight
groups of team managers on a monthly basis. The subject line changes
each month (to include the appropriate month) and the recipients
differ in each email. To simplify my life, I made a macro for each
client that looks like this:
Sub AcmeClient()
Set myolapp = CreateObject("Outlook.Application")
Set myitem = myolapp.CreateItem(olMailItem)
With myitem
..Recipients.Add ("Smith, Joe; Roberts, Bob")
Set tocontact = .Recipients.Add("Anderson, Joe")
tocontact.Type = olCC
..Subject = "Monthly Audit Report: " & Format(Date - 20, "mmmm yyyy")
Chr(13) & Chr(13) & "Please contact me if you have questions or need
more information."
..Importance = 2
End With
myitem.Display
Call InsertSig("Monthly")
Set myolapp = Nothing
Set myitem = Nothing
End Sub
This provides me with an email addressed to the correct people, with
the standard subject line and the appropriate month, and inserts a
signature that is composed of [a] two lines of text (i.e. call me if
you have question, etc) and my regular signature, which gets me
around the issues I had with dropping a pre-defined text and a
signature into the email (they were wiping each other out, so I would
end up with only a signature).
The only thing left that I want to do is spawn a dialog box to add the
file attachment that goes with the email, but I've had no luck in
figuring out that part. I'm used to the object model for Excel, but
I'm completely out of my element with Outlook.
Any suggestions?
MP-
groups of team managers on a monthly basis. The subject line changes
each month (to include the appropriate month) and the recipients
differ in each email. To simplify my life, I made a macro for each
client that looks like this:
Sub AcmeClient()
Set myolapp = CreateObject("Outlook.Application")
Set myitem = myolapp.CreateItem(olMailItem)
With myitem
..Recipients.Add ("Smith, Joe; Roberts, Bob")
Set tocontact = .Recipients.Add("Anderson, Joe")
tocontact.Type = olCC
..Subject = "Monthly Audit Report: " & Format(Date - 20, "mmmm yyyy")
Chr(13) & Chr(13) & "Please contact me if you have questions or need
more information."
..Importance = 2
End With
myitem.Display
Call InsertSig("Monthly")
Set myolapp = Nothing
Set myitem = Nothing
End Sub
This provides me with an email addressed to the correct people, with
the standard subject line and the appropriate month, and inserts a
signature that is composed of [a] two lines of text (i.e. call me if
you have question, etc) and my regular signature, which gets me
around the issues I had with dropping a pre-defined text and a
signature into the email (they were wiping each other out, so I would
end up with only a signature).
The only thing left that I want to do is spawn a dialog box to add the
file attachment that goes with the email, but I've had no luck in
figuring out that part. I'm used to the object model for Excel, but
I'm completely out of my element with Outlook.
Any suggestions?
MP-