Recurring Calender Item Property - vb.net

I am trying to read Outlook calendar appointments. I do have some serial appointments which have only one entry in my Calendar object with the property IsRecurring = 1 and RecurrenceState = 1. But I haven't found a property which says how often the appointment is recurring.
What is the best way to get this information?
The goal is by the way to display outlook appointments within a given time-span. So far I can read my serial appointments only at the date where the first entry occurs.

Related

How to display in Outlook, using VBA, a list of emails based on their EntryID (based on a list of EntryIDs stored in MS Access)

I have an Access DB that interacts with Outlook, including capturing the EntryID of selected emails as needed (which are stored in a table in Access)
I have code that allows users to view any email whose EntryID is stored, using Outlook's GetItemFromID method. This works as needed - it opens up a single email based on its EntryID.
However, what I am now looking to do is to filter the main Outlook window, to show emails based on a list of EntryIDs I have saved. So, for clarification, if I have a list of eg 3 emails (with their respective EntryIDs), the main Outlook window would be filtered to show those 3 emails. So basically like a search, but based on EntryIDs.
I can't seem to find anyway to do this? Perhaps there is a way to add a search filter via VBA that will search based on EntryIDs, but I can't find anything on this.
Any ideas much appreciated.
Binary properties like EntryID can't be used in any search or filtering operation in Outlook. You need to use any other properties (custom or user-defined ones) for filtering items in Outlook.
The View.Filter property value is a string, in DAV Searching and Locating (DASL) syntax, that represents the current filter for the view. For more information about using DASL syntax to filter items in a view, see Filtering Items.
Private Sub FilterViewToLastWeek()
Dim objView As View
' Obtain a View object reference to the current view.
Set objView = Application.ActiveExplorer.CurrentView
' Set a DASL filter string, using a DASL macro, to show
' only those items that were received last week.
objView.Filter = "%lastweek(""urn:schemas:httpmail:datereceived"")%"
' Save and apply the view.
objView.Save
objView.Apply
End Sub
Be aware, the EntryID value can be changed when items are moved between stores or folders. Moreover, the value is unique only per store.
If you need to show some items with specific EntryIDs strings you can get these item instances by using the GetItemFromID method and then marking them with a specific user property to be able to apply a filter for it. Or just add another string field to the Db with a custom value which can be added to items in Outlook, so you could easily apply a filter in the UI.

Identify Outlook meetings that include both a Teams meeting link and a Zoom meeting link

A recent Outlook updates automated the addition of Team links to every meeting invite.
I've had several meetings go sideways because the person distributing the meeting invite wasn't aware.
Is there a configuration or script to scan meetings on my calendar and identify any that have multiple meeting links (e.g., Zoom + Outlook)?
If I have a list I can either fix myself (if I'm the meeting owner) or follow up with the organizer.
Taking a quick look at an appointment set to use both Teams and Zoom, I see in OutlookSpy (I am its author) that there are a few Teams and Zoom specific named properties set (see the screenshot below).
You can search for items with both sets of properties present. The following script should find appointments like that. Assuming you run it from Outlook VBA:
set folder = Application.Session.GetDefaultFolder(olFolderCalendar)
set items = folder.Items.Restrict("#SQL=(""http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/cecp-propertyNames/0x0000001F"" IS NOT NULL) AND " & _
" (""http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/SkypeTeamsMeetingUrl/0x0000001F"" IS NOT NULL) ")
Debug.Print(items.Count)
for each item in items
Debug.Print item.Subject
next
You can create a VBA macro where you could iterate over all appointments/meetings on the calendar and check the RTFBody property whether it contains one or another meeting URL. Also you may optimize the code a bit by getting only specific calendar items or process them in chunks. To get only items that corresponds to your conditions you may use the Find/FindNext or Restrict methods of the Items class. Read more about them in the following articles:
How To: Use Restrict method in Outlook to get calendar items
How To: Retrieve Outlook calendar items using Find and FindNext methods

Limit attendees for an Outlook e-invite

I am an amateur coder.
I need to limit an e-invite in Microsoft Outlook to a certain number of attendees.
E.g. I have 500 attendees and I want to limit registration via calendar e-invite acceptance from the 11th attendee onwards ( first come first serve basis for first 10 who signs up).
How can I do that?
Thanks!
The best what could do is to handle the NewMailEx event of the Application class which is fired once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem. The EntryIDsCollection string contains the Entry ID that corresponds to that item. The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item.
So, you can track how many answers were received and modify the original appointment item to include only ten attendees.

IN VBA is it possible to get the recall message target?

Using the mail object properties I can get information about a recall message, but I don't know how to grab the information about the message it is going to remove.
The body gives the subject, but the emails being recalled in my case are not unique in sender nor in subject and so a combination of values for the target message are needed to unique them.
Thanks for your help and time,
Outis
Outlook uses EntryID property values to identify their items uniquely. Here is what MSDN states:
A MAPI store provider assigns a unique ID string when an item is created in its store. Therefore, the EntryID property is not set for an Outlook item until it is saved or sent. The Entry ID changes when an item is moved into another store, for example, from your Inbox to a Microsoft Exchange Server public folder, or from one Personal Folders (.pst) file to another .pst file. Solutions should not depend on the EntryID property to be unique unless items will not be moved.
Also you may consider adding your own ID as a user property.

How to find owner of a shared calendar in appointment and meeting window?

There is no field in the appointment Item or the meeting item that determines the current calendar which i am accessing is shared calendar or my own calendar folder?
How do i get this? Is there is a way in outlook object model to get this?
You can access the meetingItem.Parent.StoreId (not the AppointmentItem, I believe). What you get then is a HexId string that, if converted to a plain text string, contains the MS Exchange account name after /cn= (I think at the end of the string).
With that name, you can do a CreateRecipient(thatName) and Outlook.Recipient.Resolve() it.
After that, you can access the name of the account by using recipient.Name
Sorry, I tried to paste code in this answer, but it didn't work as expected and took too long. Please ask if you need more directions.