File Object

The File object represents a record of the files linked to a new or existing account, business contact, or opportunity.

Version Information
Outlook 2007

Requirements

Business Contact Manager for Outlook

Remarks

When you link a file to an account, contact, or opportunity record, the file appears in the Communication History section of the record. You can include text files, such as, contract or letters to customers, Excel sheets providing supporting data, and graphic materials.

To create a business note programmatically, do the following:

  1. Instantiate an Outlook.JournalItem object, where the journal item is of type File.
  2. Assign properties to the file.
  3. Set the Parent Entity EntryID property of the journal item to the entry ID of a new or existing account, business contact, or opportunity.

You must associate a File object with an Account, Business Contact, Opportunity, or Business Project object. The Communication History folder contains file items.

The following C# and Visual Basic for Applications (VBA) examples show how to create a new object instance of type File.

  [C#]
           Outlook.JournalItem journalItem = (Outlook.JournalItem)historyFolder.Items.Add("IPM.Activity.BCM");

              if (journalItem.UserProperties["Parent Entity EntryID"] == null)
            {
                userProp = journalItem.UserProperties.Add("Parent Entity EntryID", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText, false, false);
                userProp.Value = accountEntryID;
            }

            journalItem.Subject = "ExisitngFile.txt";
            journalItem.Type = "File";

            if (journalItem.UserProperties["LinkToOriginal"] == null)
            {
                userProp = journalItem.UserProperties.Add("LinkToOriginal", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText, false, false);
                userProp.Value = @"c:\ExisitngFile.txt";
            }

            journalItem.Save();

FakePre-a1365ea5c38a4e5897fb3b0beb2b46b6-90144dced07a476b95d002faffc92ab4

User Properties (Business Contact Manager only)

None. All properties derive from the parent object.

Parent Objects

JournalItem Object

For more information, download the Outlook 2007 Developer Reference by going to the 2007 Office System: Updated Developer Content Web site.

See Also

Appointments | Business Notes | E-Mail Messages | Phone Logs | Tasks