How to open a specific link automatically with outlook 2016

Alipio

Member
Outlook version
Outlook 2016 64 bit
Email Account
IMAP
Hi, i´m a novice in this subject and I hope Diane can help me.

I have a code to open automaticly an email from a defined sender.
I´m having problems to join the code to click in a certain link. May I have your help please?
What I need is open the email when he arrives and click in the link in a defined text

I have this:

Public WithEvents objInbox As Outlook.Folder
Public WithEvents objInboxItems As Outlook.Items

Private Sub Application_Startup()
Set objInbox = Outlook.Application.Session.GetDefaultFolder(olFolderInbox)
Set objInboxItems = objInbox.Items
End Sub

'Occurs when incoming emails arrive in Inbox
Private Sub objInboxItems_ItemAdd(ByVal Item As Object)
Dim objMail As Outlook.MailItem
Dim strSenders As String
Dim varSenders As Variant
Dim i As Long


If TypeOf Item Is MailItem Then
Set objMail = Item

'Change the specific persons
strSenders = "Alijos@gmail.com"

varSenders = Split(strSenders, ";")

'Open the emails from specific persons
For i = 0 To UBound(varSenders)
If objMail.SenderEmailAddress = varSenders(i) Then
objMail.Display
Exit For
End If
Next
End If
End Sub

And what I need is to click automaticly in a link with the text "Fich a Subm Contab"

wayting for your help
 

Lewis-H

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
Open hyperlink without holding Ctrl in Outlook
  1. On the File tab, click the Options button:
  2. In the Outlook Options dialog box, on the Mail tab, click the Editor Options button:
  3. In the Editor Options dialog box, on the Advanced tab, under Editing options uncheck Use CTRL+Click to follow hyperlink:
  4. Click OK.
 

Alipio

Member
Outlook version
Outlook 2016 64 bit
Email Account
IMAP
Open hyperlink without holding Ctrl in Outlook
  1. On the File tab, click the Options button:
  2. In the Outlook Options dialog box, on the Mail tab, click the Editor Options button:
  3. In the Editor Options dialog box, on the Advanced tab, under Editing options uncheck Use CTRL+Click to follow hyperlink:
  4. Click OK.
Hi Lewis-H, thank you for your time. and what should I expect with this procedure?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You need to merge it with this code -

I think this will work - the pattern might need tweaked though.
.Pattern = "Fich a Subm Contab <(.*)>"

Copy one of the messages to the junk email folder and see how it looks in plain text - that is what you need the pattern to look like.
 

Attachments

Alipio

Member
Outlook version
Outlook 2016 64 bit
Email Account
IMAP
Diana, I don´t have word enough to thank you.... it works great.... you are really a GEM... but a big one.
 
Top