User Defined Fields in Outlook 2010

Status
Not open for further replies.

Kath81

New Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Totally lost.

I've had to import a few mailboxes onto our system for the content to be analysed. There are about 2,500 mail items spread over five independent mailboxes.

I have been asked if it's possible to give each mail item a number (for ease of reference and filing etc) and whether those numbers can continue through to the next mailbox, i.e. in MailboxA, all mail items would be numbered 1-500 and in MailboxB we would want to start from 501.

I thought it might be possible by adding a user defined field but I don't know how to add information to that user defined field, so I can't even start experimenting.

Could someone help me please?
 
You can add a field and as long as you are importing/exporting the mail as mail, not as CSV, it will work.

The macro at http://www.slipstick.com/outlook/email/sort-messages-sender-domain/ should point you in the right direction - it works with selected messages. If you don't know how to change it to work with all mail in a folder, see http://www.slipstick.com/developer/code-samples/working-items-folder-selected-items/

You'll need to replace this part with code that counts -
Code:
Set objMail = obj
        
         strDomain = Right(objMail.SenderEmailAddress, Len(objMail.SenderEmailAddress) - InStr(1, objMail.SenderEmailAddress, "@"))
         Set objProp = objMail.UserProperties.Add("Domain", olText, True)
         objProp.Value = strDomain
        objMail.Save

replace it with something like this

Code:
'at the top, before for each
dim i as long
set i  = 1

' replace the code block with this
Set objMail = obj
    
         strDomain = i
         Set objProp = objMail.UserProperties.Add("Index Number", olText, True)
         objProp.Value = strDomain
        objMail.Save

i = i +1

You could add the mailbox name or other text to the string to help identify the mailbox it came from.
 
This code adds the "received by name " to the index number - that should be the mailbox name. It starts at zero and remembers the last number used during the current session. If you need to remember the last number used between sessions, you need to write the last number to a file or registry.

Because the text field sorts numbers wrong, you could use this instead:
strDomain = i
Set objProp = obj.UserProperties.Add("Index Number", olInteger, True)

But can't use the mailbox name in same field.


Code:
    Dim i As Long

Public Sub SetDomain()
    ' From http://slipstick.me/1
    Dim currentExplorer As Explorer
    Dim Selection As Selection
    Dim obj As Object
    Dim objProp As Outlook.UserProperty
    Dim strDomain As String, strAcct As String
    Dim propertyAccessor As Outlook.propertyAccessor

    Set currentExplorer = Application.ActiveExplorer
    Set Selection = currentExplorer.Selection
 
    On Error Resume Next

    For Each obj In Selection

' Add mailbox name
        Set propertyAccessor = obj.propertyAccessor
        strAcct = propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0040001E")
  
  
         strDomain = strAcct & " " &  i
         Set objProp = obj.UserProperties.Add("Index", olText, True)
         objProp.Value = strDomain
        obj.Save

    i = i + 1

        Err.Clear
    Next

    Set currentExplorer = Nothing
    Set obj = Nothing
    Set Selection = Nothing
End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Z Import Tasks from Access Using VBA including User Defined Fields Outlook VBA and Custom Forms 0
S User Defined Fields adding new value (2) Using Outlook 0
M vCard does not have user-defined fields from my custom contact form (365) Using Outlook 1
F MAPI, User Defined Fields and perspective after 20 years Outlook VBA and Custom Forms 0
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
M Multiple User Defined Fields that can be added, changed, updated using VBA and user form Outlook VBA and Custom Forms 0
R User Defined Fields adding new value Using Outlook 3
S VBA with User Defined fields Outlook VBA and Custom Forms 9
M Map Outlook user defined fields onto a Sharepoint list ??? Outlook VBA and Custom Forms 1
N How to retrieve user defined fields values to bcm form. Using Outlook 2
N How to disable user defined fields in BCM forms Using Outlook 2
P User-Defined Relationship Fields: Invisible? BCM (Business Contact Manager) 0
W Template to produce calendars with wrapped text & user-defined fields? Using Outlook 1
R writing "Instant Search" queries to find User-Defined fields Using Outlook 0
P Joining the User Defined Fields to their User Field<n> counterpart BCM (Business Contact Manager) 0
E Accessing User Defined Fields in BCM Database part 2 BCM (Business Contact Manager) 0
E [SOLVED] Accessing User Defined Fields in BCM Database part 1 BCM (Business Contact Manager) 9
J User Defined Fields Outlook VBA and Custom Forms 6
J user defined fields Outlook VBA and Custom Forms 2
P Where are User-defined fields stored in BCM 2010 database? BCM (Business Contact Manager) 2
M User defined fields Outlook VBA and Custom Forms 6
J User defined fields with pre-defined values Outlook VBA and Custom Forms 3
J Where does BCM store User-Defined fields in the database? BCM (Business Contact Manager) 3
D User-defined fields and multiple forms BCM (Business Contact Manager) 1
T User Defined Fields vs. Area of Interest BCM (Business Contact Manager) 1
C User Defined Fields BCM (Business Contact Manager) 3
Witzker Outlook 2019 Macro GoTo user defined search folder Outlook VBA and Custom Forms 6
Witzker Outlook 2019 How to get a Photo in a User Defined Contact form Outlook VBA and Custom Forms 2
Witzker Outlook 2019 Macro to send an Email Template from User Defined Contact Form Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Edit contact from email does not open the user defined contactform Using Outlook 3
Witzker Place cursor at opening, a user defined OL contact form Outlook VBA and Custom Forms 3
J How to create a drop down user defined field that will appear on an inbox view Outlook VBA and Custom Forms 8
J VBA Cannot programmatically input or change Value for User Defined field Using Outlook 1
H Information from user defined field into Excel Outlook VBA and Custom Forms 7
B User defined field for messages with 'me' in the [To], [Cc] line Using Outlook 0
R Creating a user defined function Outlook VBA and Custom Forms 3
M Compile error: User-defined type not defined Outlook VBA and Custom Forms 0
C Outlook 2016 Conditional Format for User Defined Field Using Outlook 1
N How to set automatically the default or user defined Quickstyle Templates by Answer in Outlook Using Outlook 1
Daniel Schunk User-defined form arrives empty at the recipient Using Outlook 3
J Assess content of User Defined Field in Rule Using Outlook 3
S Outlook User defined date field (UDF) not syncing Using Outlook 2
G how can Apply User-defined Field to all Sub Folder and Other Using Outlook 14
F Adding User Defined Field to another form Using Outlook 0
G How to let data in an account user defined field appear in the same field all related opportunities BCM (Business Contact Manager) 1
V Extracting user-defined details from a public folder Outlook VBA and Custom Forms 2
J How to show the "value" of a user-defined Account field in a Contact Record BCM (Business Contact Manager) 2
Witzker Outlook bug when creating a user defined contact form? Using Outlook 1
Wotme Syntax for user defined field in VBA Using Outlook 1
J How to create a user defined dropdown list field for a custom contact form Using Outlook 3

Similar threads

Back
Top