I would like to add the ItemAdd event to multiple folders. The difficulty that I had is the the number of folders is not fixed, but they are all sub-folders of a main folder.
Create a list that will hold Items objects (List), set up the event handler on each Items object, add them to the list to make sure they stay referenced.
Related
Sometimes in Outlook I want to be able to see the last few emails I received or sent to a client.
As there can be several individual email addresses per client, the only way to reliably identify emails as belonging to a client is to look at the domain part of the email address, eg the company in person#company.com
How can I add this as a sortable column in the main views (Inbox, Sent Items, etc)?
Almost found what I want from here (I've improved on the formula).
Add a new column to a view from the Show Columns dialog, click New Column and enter a new formula based column:
IIf(InStr([SearchFromEmail], "#") = 0, "", Mid([SearchFromEmail], InStr([SearchFromEmail], "#") + 1))
Similar question was asked here https://superuser.com/questions/703013/outlook-how-to-display-sender-email-address-in-inbox/703035#703035
Be aware, the ItemAdd event of the Items class is not fired when multiple items are added to the folder at the same time.
You can handle the NewMailEx event of the Application class which is 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.
In the event handler you can add a user property which can be user in the UI for sorting items (MailItem.UserProperties.Add). The CurrentView property of the Folder class returns a View object representing the current view.
The View object allows you to create customizable views that allow you to better sort, group and ultimately view data of all different types. There are a variety of different view types that provide the flexibility needed to create and maintain your important data.
- The table view type (olTableView) allows you to view data in a simple field-based table.
- The Calendar view type (olCalendarView) allows you to view data in a calendar format.
- The card view type (olCardView) allows you to view data in a series of cards. Each card displays the information contained by the item and can be sorted.
- The icon view type (olIconView) allows you to view data as icons, similar to a Windows folder or explorer.
- The timeline view type (olTimelineView) allows you to view data as it is received in a customizable linear time line.
Views are defined and customized using the View object's XML property. The XML property allows you to create and set a customized XML schema that defines the various features of a view.
Not out of the box. You can process all your existing emails (and automatically process all new items using MAPIFolder.Items.ItemAdd event on the folders that you want to process) to set a user property (MailItem.UserProperties.Add) to the value extracted by your code. If you modify the folder views to include your property, you will be able to see it.
I use a TOpenDialog component in Delphi XE7, because I want to select one or more files. However, after I select them and click OK, the selected files are stored already sorted alphabetically, from A to Z, in the Files property, thing which I do not want. I didn't see any switches or options neither in the TOpenDialog control, nor in the TStrings type.
How can I make this component store the selected files exactly in the order that I want to?
The underlying dialog box from the operating system doesn't keep track of that information (or if it does, it doesn't expose it in any way), and the wrapper class provided by Delphi doesn't synthesize it for you.
You can handle the OnSelectionChange event to deduce the selection order. Begin by creating your own ordered list to hold the selected files. When the event is triggered, inspect the dialog's Files property. Remove any entries from your internal list that aren't present in Files. For any items in Files that you don't already have, add them to the head of your list.
The system dialogs do not keep track of the order in which the items are selected. You have no way to get the system dialog to tell you that information. If you really need that then I see two options:
Write your own dialog that does keep track of order of selection.
Let the user specify order outside the file selection dialog.
Is there a way of getting a list of classes available in javafx.scene.control and the events of each one?
I would like to have in a table all the controls available in javafx (obviously those that come with it) and in another table all the events associated to each control.
Thanks.
Just use the Javadocs and look at the list of properties defined for each class. Properties whose names being "on" represent event handlers, so indicate that the control (or other node) fires properties of the indicated type.
So for example, Button has an onAction property of type EventHandler<ActionEvent>, so you can register handlers for action events with it.
All properties (whether or not their name matches the onXXX pattern) represent observable properties with which you can register ChangeListeners or InvalidationListeners. So Label has a text property with which you can register a ChangeListener that will be notified if the text changes.
Is there any way to make individual events editable as opposed to making the entire events array editable?
Thanks,
Shruthi
Each event has an editable=true/false property.
--patrick
In my add-in I build List<> objects of specific file types (which are project items) during the Connect() event. In order to check and possibly append new items as and when these are added I've bound the relevant event:
ProjectsEvents.ItemAdded += ProjectsEvents_ItemAdded;
But the event only passes the Project which contains the new item, not the new item itself. So my question is, inside my ProjectsEvents_ItemAdded(Project proj) event, what's the best way to get this new item?
Do I have to iterate through all items in this project and determine whether I'm already aware of them?
Try ProjectItemsEvents.ItemAdded.