Solved: Need Outlook script

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

bigtalker

Thread Starter
Joined
Aug 1, 2007
Messages
4
Outlook 2003 on Win2K

I receive emails that I filter into a specific folder. These emails include a link to an unique URL that I must click to verify I have received the specific email.

How would I create a script to call from my Outlook rules to automate this process to unconditionally click the link as soon as the email hits the specific folder?

Thanks in advance
 
Joined
Sep 4, 2003
Messages
4,916
I don't think this can be processed automatically through Outlook rules. You may be able to use some VBA (Visual Basic for Applications) to accomplish this. The code would fire on the new mail event in Outlook and check each email for a hyperlink and take action. Does the link show target path?


Regards,
Rollin
 

bigtalker

Thread Starter
Joined
Aug 1, 2007
Messages
4
Rollin_Again said:
I don't think this can be processed automatically through Outlook rules. You may be able to use some VBA (Visual Basic for Applications) to accomplish this. The code would fire on the new mail event in Outlook and check each email for a hyperlink and take action. Does the link show target path?


Regards,
Rollin
Thanks, Rolloi. I sent you an email about this as well.

Here is the body of a typical email. The link is unique for each email

Thanks for your attention

Bigtalker

++++++++++++++++++++++++++++++
Please note that a Installation (SR9999999) located in zip XXXXX has been tentatively scheduled for Friday, 11/09/2007 with an arrival window of 13:00 to 17:00. To confirm this appointment, please click the link below, or feel free to call XXX at 1.800.999.9999.

http://esp.xxxxxxxxxxxxxxxx.com/con...?key=MTI0NjQxMjAuNjY5MjcyMDAgMTE5NDIwNTYxOA==

Thank you,
 
Joined
Sep 4, 2003
Messages
4,916
Open Outlook and press ATL + F11 to open the VB editor. One the left hand side of editor there will be a small project explorer window. Locate the object/folder called Microsoft Office Outlook Objects and click on the plus sign (+) and expand the object if needed. Look for the item labeled ThisOutlookSession and right click it and select VIEW CODE. When the blank code module opens up copy and paste the code below into it and save the application. Just change the folder path where I have commented in the code and also make sure Macros are enabled in Outlook. Make sure to turn your rule off since the code has logic to move the message already.

Code:
Dim objMapiName As Outlook.NameSpace
Dim oIE As Object

Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True

Set objMapiName = Application.GetNamespace("MAPI")
Set vFolder = objMapiName.Folders("Personal Folders").Folders("Inbox").Folders("Test")

'****************************************************
'CHANGE THE DESTINATION FOLDER PATH IN THE LINE BELOW
'****************************************************

Set myDestFolder = objMapiName.Folders("Personal Folders").Folders("Inbox").Folders("Endeavor")

'YOU COULD ALSO DRILL DOWN FURTHER INTO A DEEPER FOLDER PATH
'Set myDestFolder = objMapiName.Folders("Personal Folders").Folders("Endeavor").Folders("New Vonage Sked")

LoopItems:

For i = 1 To vFolder.Items.Count

If vFolder.Items.Count = 0 Then

End

End If
 
Set myItem = vFolder.Items.Item(i)

If Trim(myItem.Subject) = "Vonage Schedule Notification" Then

myItem.UnRead = False

myItem.Move myDestFolder

i = i - 1

vString = Mid(myItem.Body, InStr(1, myItem.Body, "http:"), Len(myItem.Body))

vLink = Left(vString, InStr(1, vString, "Thank") - 1)

oIE.Navigate (vLink)

Do While oIE.busy
Loop

End If

Next i

oIE.Quit

Set oIE = Nothing
Set objMapiName = Nothing
Set vFolder = Nothing
Set myDestFolder = Nothing
 

bigtalker

Thread Starter
Joined
Aug 1, 2007
Messages
4
Thanks, bunches, Rollin'

Works great and I also get a quick intro to VB macros!!

Your efforts in support of users of these forums are heroic.
 
Joined
Sep 4, 2003
Messages
4,916
Feel free to Mark this problem as SOLVED by using the thread tools at the top of the page. Are you able to verify that the links have been opened correctly by the code? The code is designed to loop through each item in the Inbox and check for the subject line of your choice. This code may be inefficient if you have thousands of items in your Inbox. If the processing time seems to long or memory intensive just let me know and we'll come up with a work-around for you.

Regards,
Rollin
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top