Send to mobile from folder, not inbox

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

I am new to programming and learning vb.net 2003 right now. I was looking
for
a jump start on some of the code for what i would like to do.

I was wondering if someone might be able to help me with some code or if
anybody has similar code to do this - I am doing vb right now and will be a
while before i get to vba.

I would like to have a code that i could put in as a rule - "run a script" -
that would send an e-mail ([email protected]) to my cell phone and
cut it off at 100 or so characters(or not cut off, don't know how hard that
would be).

For an example - I get an e-mail from my wife in my inbox - the rule takes
over and moves it to the "wife" folder, then it goes to the "run script"
part
of the rule and shoots me off a 100 character e-mail to my cell phone. BUT,
if I want to make it do the same thing for the "Boss" folder i can have it
run the same script.

I know there are programs out there that do the same function, but none have
really worked. I tried VersaForward and it works, but not if you have a rule
that moves it to a folder it only reads the inbox. Another problem is that
it
sends everything in the inbox, if there is spam it send that to the phone,
not to mention it lets the spam sender know that the e-mail are being read
so
i get more spam (because VF has to 'read' the e-mail to send it on).

Thanks for any help in advance.

Matt
 
VB.NET will not help you here. A "run a script" rule requires a VBA
procedure, specifically a Public Sub with a MailItem or MeetingItem
argument. The code would look something like this:

Public Sub PhoneMe(Msg as MailItem)
Set objMail = Application.CreateItem(olMailItem)
With objMail
.Subject = Msg.Subject
.To = (e-mail address removed)
.Body = Left(Msg.Body, 100)
.Send
End With
Set objMail = Nothing
End Sub

Note that if you're using Outlook 2002, the Send command will trigger a
security prompt.
 
That is great and i appreciate the help, honestly!

But, I didn't state in the first post that this if for when I am out of the
office. I will not be there to accept the security prompt! Is there any
way around this???

I am in Outlook 2003 an XP.

Thanks

Matt
 
You shouldn't get a security prompt with Outlook 2003 VBA and the code
below. If you do, let us know what build number you're using (Help | About)

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sorry for the delay....

This is what I have, outlook 2003(11.6359.6360) SP1

the security prompt is for accessing the address book, I am on an exchange
server - does that have anything to do with it?

Matt
 
Can you determine which statement is triggering the security prompt?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top