Michael Bauer said:
Yes, of course, I forgot to write the method
It should be:
Set oCmd=Application.ActiveInspector.CommandBars.FindControl(,3165)
Thanks, that works and explains why I couldn't parse it out from
CommandBars directly.
Do you want to send sent items again? Then you don´t need that command.
No, I am trying to do almost precisely what resend (the menu
item) does, that is, to send the email from a "spam" folder to
a spam (or "ham" folder to ham) classification system on my
mail server.
I need to do as little change to the original mail as possible and
have been trying to obtain the RFC822 original form of the emails
to just bulk load them (zip or whatever) but this "resend" seems
to be close enough as it changes the headers VERY little (probably
in an acceptable way) and does not change the message or subject
at all.
Doing this message by message is ok, but way to slow. I want
my users to be able to just select a folder or group of messages and
without having to input the destination, or agree to the "you do not
appear to be the original sender" popup, just have them sent to a
known address on the email server.
Say, (e-mail address removed)
Looping through is the relatively easy part -- getting the effect of
either resend or saving the 'original' message to disk as a separate
file is the hard part (for me) so far.
Thanks for the help -- I would love to hear if you have other ideas....
BTW, my SpamAssassin installation can autolearn these message as
either Spam or Ham if I can get this to work.
Just loop through the folder Items or Selection, copy each MailItem and
send it, sample:
Sub SendAgain()