help with outlook scripting

Status
Not open for further replies.

sblee

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server
Dear All

Really appreciate if someone can help on this. As i am very bad with Vba scripts.

Is there anyway to auto fill in the "X" in the Approve checkbox when i receive an email such as below and auto reply to the sender?

Example:
Sender: XXX@email.com.sg
==Email body start==

Mark "X" if you approve in the checkbox below
Approve ( ) Reject ( )

==Email body end==
 

sblee

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server
Thanks Diane, appreciate it!

If it's not too much to ask, If i wanted to reply to the sender after replacing the body. Will the below work?

Sub SendNew (Item As Outlook.MailItem)

Dim objMsg As MailItem
Set objMsg = Application.CreateItem(olMailItem)

objMsg.Body = replace (item.body, "Accepted ( )", "Accepted (x)")
objMsg.Subject = "FW: " & Item.Subject
objMsg.Recipients.Add "XXX@email.com.sg "

objMsg.Send

End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
in a rule, yes, it should work. Change Send to Display and test it - that will open it on screen so you can see.

to test the script on a selected message, use this macro:

Code:
Sub RunScript()
Dim objApp As Outlook.Application
Dim objItem As MailItem
Set objApp = Application
Set objItem = objApp.ActiveExplorer.Selection.Item(1)

'macro name you want to run goes here
SendNew objItem

End Sub
 

sblee

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server
Thanks for the advice Diane.

I tried the script on my email and it works!

Appreciate the help.



Sent from my SM-G960F using Tapatalk
 
Status
Not open for further replies.
Top