Activities in Outlook

Status
Not open for further replies.

SMB

New Member
Outlook version
Outlook 365 64 bit
Email Account
Office 365 Exchange
As most on this forum probably agree, it was a sad day when MS removed the activities tab. I recently can across this VBA code to create an activates search, run running it I get an error, see below in red. Is this repairable, made to work for o365?

I will also attempt to get Search for All Messages from Contact and Display in New Window working.

Thank you all in advance for your help and contributions.

Sub FindContactActivities()

'=================================================================
'Description: Outlook macro to find all items related to a contact
' similar to the Contact Activities feature.
'
' author : Robert Sparnaaij
' version: 1.0
' website: Reviving the Contact Activities feature in Outlook 2013 - HowTo-Outlook
'==================================================================


If Application.Session.DefaultStore.IsInstantSearchEnabled Then

Dim olkExplorer As Outlook.Explorer
Set olkExplorer = Application.Explorers.Add(Application.Session.GetDefaultFolder(olFolderInbox), olFolderDisplayNormal)

Dim oItem As Object
Set oItem = Application.ActiveInspector.CurrentItem

If oItem.Class = olContact Then
Dim myContact As Outlook.ContactItem
Set myContact = oItem

Dim myContactAddress As String
Dim myContactName As String

myContactAddress = myContact.Email1Address
myContactName = myContact.FullName


Dim olkFilter As String

'Linked Contacts
olkFilter = "contactnames:(" & Chr(34) & myContactAddress & Chr(34) & " OR " & Chr(34) & myContactName & Chr(34) & ")"

'From this contact
olkFilter = olkFilter & " OR " & "from:(" & Chr(34) & myContactAddress & Chr(34) & " OR " & Chr(34) & myContactName & Chr(34) & ")"

'To this contact
olkFilter = olkFilter & " OR " & "to:(" & Chr(34) & myContactAddress & Chr(34) & " OR " & Chr(34) & myContactName & Chr(34) & ")"


Call olkExplorer.Search(olkFilter, olSearchScopeAllOutlookItems)

Call olkExplorer.Display

Else

MsgBox "Please run this command from an opened Contact item.", vbExclamation, "Open a Contact item"

End If

Set olkExplorer = Nothing
Set myContact = Nothing

Else

MsgBox "Search Indexing is not enabled for this mailbox." & vbNewLine & vbNewLine & _
"If you are using an Exchange account, make sure that Cached Exchange Mode is enabled" & _
vbNewLine & vbNewLine & _
"To troubleshoot Search Indexing see: " & vbNewLine & _
"Fixing Instant Search - MSOutlook.info", _
vbExclamation, "Search Indexing not enabled"

End If

End Sub
 
Do you have the message open our selected?

This works with a selected contact -
 
Diane,

Yes, thank you they both worked. I just needed to change the name of the macro (showing my novice-ness).

Do you know of a way to include tasks in these searches? I am trying to use tasks as opposed to the Journal.

I also notice I have companies in a tool I used from MapiLab, but they do to show in the folders list. That would be nice is they did.

I am trying to build the simple features I used from BCM into O365.

Thanks again for your help.

Stuart
 
The scope for that would be olSearchScopeAllOutlookItems but to/from field shouldn't work on the contact field (assuming you linked it to a contact). I'll see what needs changed to work on everything.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Werewolf Workaround for the missing Activities tab in Contact Folder Properties in Outlook 2010? Using Outlook 2
Diane Poremsky Outlook 2010 & Contact Activities Using Outlook 0
F Outlook 2010 Activities search finds nothing Using Outlook 4
J Outlook replacement options - contact journal activities lost Using Outlook 23
C Tracking Activities in Outlook Calendar Using Outlook 1
S Outlook 2010: How do you enable Contacts' Activities to search archive folders Using Outlook 6
R Outlook 2010 Contact Activities Using Outlook 14
N Moving communication history and activities from BCM to OUtlook BCM (Business Contact Manager) 2
N Moving contacts and activities from BCM to OUtlook BCM (Business Contact Manager) 4
N contact notepad 'style' getting changed after clicking and running Activities Using Outlook 2
P activities tab 2013 Using Outlook 1
J Cannot Find Activities 2010 Using Outlook 14
R Activities - Speeding up retrivel Using Outlook 1
A New Outlook - Cannot drag IMAP emails to Task List in MyDay Using Outlook 0
L Android Outlook Doesn't Update PC Notification Changes Using Outlook 0
A How to open Excel file saved in Outlook folder? Outlook VBA and Custom Forms 4
D.Moore Outlook desktop client suggested searches question Using Outlook 16
Y Outlook 2016 (64-bit) Copy Local Cal. Events to Another Cal. with Modified Reminder time Using Outlook 2
T Outlook 2019 While connecting an IMAP account in "classic" Outlook 2024 I caused a massive duplication of emails on the server (death loop) Using Outlook 5
D Cannot logon to Outlook.com, or outlook on Mac, outlook not updating on ipad, iphone Using Outlook 1
J unable to get my new install of Outlook to display mailboxes in the single-line format. Using Outlook 1
D Legacy Microsoft Outlook for Mac Support will end in Oct 2025 Using Outlook 5
C Nasty Bug Lurking In Outlook For Years. The Trigger. Any Fix Or Workaround? Using Outlook 11
R Auto clicking Hyperlink in outlook Outlook VBA and Custom Forms 7
ughlook Open multiple contacts in NEW Outlook? Using Outlook 3
G Outlook translation feature is off Using Outlook 2
J Outlook 2010 does not let me put any account Using Outlook.com accounts in Outlook 3
P 3 of 5 PST files don't install from d:\outlook but only from D:\ Using Outlook 7
HarvMan January Windows 10 preview update force installs new Outlook Using Outlook 1
L Outlook 2010 - new installation on Windows 11 - aplzod32.dll is not a valid Add-in Using Outlook 12
J Outlook troubleshooting/logging - option grayed out Using Outlook 2
B Arrows missing from Outlook emails vertical scrollbar Using Outlook 0
G Outlook 2021 (New) doesn't respect default browser Using Outlook 9
B Outlook or iPhone turning tabs into spaces in Outlook Notes Using Outlook 1
P newly installed Office 365 includes OLD Outlook Using Outlook 6
R Outlook ribbon menu default? Using Outlook 7
H Spam email in Gmail not visible in Outlook Using Outlook 3
J How to transfer Win 10 Outlook to new Windows 11 pc? Using Outlook 16
J Renegade spam URL line displayed in old local Outlook 365 email title Using Outlook 3
G Reduce whitespace in Outlook desktop Contact Cards display Using Outlook 3
C Outlook classic via 365 Using Outlook 2
Dr. Demento Analogous Outlook code to read info into an array (or collection or whatever) Outlook VBA and Custom Forms 7
S Repair Outlook Using Outlook 8
V Outlook Form ListBox is not editable Outlook VBA and Custom Forms 2
F Outlook's contacts Using Outlook 1
D Outlook 2003 stopped dead Using Outlook 2
G Cannot receive emails from gmail account in Outlook 365 Using Outlook 1
E "Cannot display the folder. MS Outlook cannot access the specified file location" Using Outlook 8
P Outlook 2016 Working Offline Using Outlook 2
Rupert Dragwater Cannot reestablish gmail (email address) account in Outlook 365 Using Outlook 11

Similar threads

Back
Top