Need MS Outlook field names

tonez90

Registered User.
Local time
Today, 20:51
Joined
Sep 18, 2008
Messages
42
I am developing a scheduling database and wish to read in emails. I can get the email into access but am uncertain about the field names. Below is the code I currently have and I am after a list of the field names used in MS Outlook email.
If someone can help with these names I would be aprreciate.

cheers
heres my code so far:
Public Function Scan_Inbox_only()
On Error Resume Next
Dim att_i As Integer
Dim rs1 As Recordset
Dim rsBOM As DAO.Recordset
Dim tmpstr As String
Dim OlApp As Outlook.Application
Dim Inbox As Outlook.MAPIFolder
Dim InboxItems As Outlook.items
Dim Item As Object
Dim Mailobject As Object
Dim item_att As Attachment
Set OlApp = CreateObject("Outlook.Application")
Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox)
Set InboxItems = Inbox.items
'delete all existing email information
currentdb.Execute "DELETE * FROM UsysRef_Tmp_Email", dbFailOnError
currentdb.Close

If Inbox.items.Count = 0 Then
MsgBox "There are no messages in your Inbox.", vbInformation, "Nothing Found"
Exit Function
End If
Dim filename As String

For Each Mailobject In InboxItems
filename = ""
att_i = 0
For Each item_att In Mailobject.attachments
filename = filename & "; " & item_att.filename
att_i = att_i + 1
Next item_att
Set rs1 = currentdb.OpenRecordset("UsysRef_Tmp_Email", dbOpenDynaset)
rs1.AddNew
rs1![datesent] = Mailobject.SentOn
rs1![whosent] = Mailobject.SenderName
rs1![dateRecieved] = Mailobject.Received
rs1![Read] = iif((Mailobject.UnRead = True), "UnRead", "Read")
rs1![To] = Mailobject.To
rs1![CC] = Mailobject.CC
rs1![Subject] = Mailobject.Subject
rs1![Body] = Mailobject.Body
rs1![num_attachment] = att_i
rs1![name_attachment] = iif(Left(filename, 1) = ";", Right(filename, Len(filename) - 2), filename)
rs1.update
rs1.Close
Set rs1 = Nothing
Next
currentdb.Close
MsgBox ("Scan of Inbox completed")
End Function
 
I am developing a scheduling database and wish to read in emails. I can get the email into access but am uncertain about the field names. Below is the code I currently have and I am after a list of the field names used in MS Outlook email.
If someone can help with these names I would be aprreciate.

In 2003 if you right click on the bar where you have to/from/subject then you should have the choice "Field Chooser" or just do a search for "How do I see Field Chooser" for a more professional explanation.

You might find that in the Outlook Object Explorer that when you look at the Mailitem object that all the properties there are actually your so called "Fields". For example if I want to be able to find a mailitem or appointment item which I have made with VBA, I add a unique number to the Mileage "field". Then if I ever need to find it again I search for this number in the mileage field. Mileage seem to be a property of most objects.

Whilst I have never done it MAPI has hidden "Fields" as well. This link might help http://www.cdolive.com/cdo10.htm
 
Thanks for the reply but I must be having a dumb day as I cant eem to get this to display anyfields that can be used in VBA.

Does anyone just have a list of email fileds?
 
For an email which is a mailitem object in the VBA object browser your so called "fields" are going to be pretty much every string property of a mailitem.

The method I showed below however would allow you to see any customized fields because Outlook can be customized to have extra fields added.

But good luck with getting a list and please post your link to the list when you find it.
 

Users who are viewing this thread

Back
Top Bottom