Limit attendees for an Outlook e-invite - vba

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.

Related

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

Recurring Calender Item Property

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.

Outlook 2013 Auto-Reply with retained information from previously received email

Please see example email below:
"We have tickets available for the following basketball game:
Please email only me if you are interested and let me know which
section you want.
Please be sure to make your selection carefully and only reply once.
Basketball Game is on Tuesday 3/10 - 2 sets of 2 tickets.
Tuesday 3/19/2014 Cleveland 7:30PM
Section 101 Row K 16 – 17
Section 101 Row K 18 - 19
Section 124 Row K 1 - 2
Section 124 Row K 3 - 4"
How would I auto reply to this email with a default response of one of the selected rows?
For example, I would like my default auto-reply email to state the
following:
"Section 101 Row K 16-17. Thanks, Joe"
Details: I would like this to auto-reply to the sender EVERY time an email is received from the same sender. Basically I have to be the first to respond to an email in order to receive tickets to a basketball game. First come first serve.
You can create a VBA macro or develop an Outlook add-in if you need to get the code working on multiple PCs. The NewMailEx event of the Application class is fired when a new item is received in the Inbox.
But the simplest way is to develop a VBA macro which can be run by the Outlook rule. For example, the rule may recognize such emails and run a macro sub which should be in the following format:
public sub Test(mail as MailItem)
' do whatever you need there
end sub
where the mail object passed as an argument represents the incoming email.
In the sub you need to use the following methods from the Outlook object model:
The Reply method which creates a reply, pre-addressed to the original sender, from the original message.
The Body property which allows to set a string representing the clear-text body of the Outlook item.
The Send method which sends the e-mail message.
You may find the Getting Started with VBA in Outlook 2010 article in MSDN.

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.

Tracking item within a collection on WP7

I'm building a WP7 (VB.NET) app and have a custom class, PinInfo, of which I have two ObservableCollections, TempPins and FavoritePins.
In various parts of the app, I need a unique identifier to get a reference to a particular PinInfo in the collection, so at present, I assign an ID to the PinInfo when it's added to the collection, then later get a reference to the pin via the ID.
For example, if I create a button to delete a pin, I set its tag to the pin's ID, then the button click handler reads the button's tag to get the corresponding pin from the collection (via LINQ).
I generate the ID by adding one to the last-assigned ID, but these lists are often modified (i.e. items removed), so I end up with needlessly large ID numbers (e.g. just a few items, with IDs in the thousands).
How can I structure this better?
You could use a Guid instead of an integer ID.