Linked Outlook file does not bring over Categories field...

J

jimmy fallon

I know this may be the wrong forum, but nobody is answering me in the other
one. This seems to me to be a simple issue, but I can't find and answer.
When I link to an Outlook contact folder using the "external data" tab and
then clicking on "more" then outlook, it brings over every field accept for
the categories field. How am I supposed to separate my business contacts from
my personal ones? I can't create a separate Outlook folder because, I need to
sync all with my phone, and the phone only syncs to the contacts folder. Not
looking for a work around, looking for the way to bring Categories field over.
Thanks if you can...
jf
 
A

a a r o n . k e m p f

yes, sometimes you have to iterate through the outlook object model
(using VBA)

this example is based on emails, not contacts
http://www.freevbcode.com/ShowCode.Asp?ID=1154

Public Function SaveAttachments(Optional PathName As String) _
As Boolean
'************************************************************
' USAGE: SAVES ATTACHMENTS FROM INBOX TO A DIRECTORY

' PARAMETER: PATHNAME (OPTIONAL): WHERE TO SAVE THE FILES.
' IF NOT PROVIDED, THE SYSTEM'S TEMPORARY DIRECTORY IS USED

' REQUIRES: OUTLOOK TO BE INSTALLED ON RUNNING MACHINE AND
' A REFERENCE TO THE OUTLOOK OBJECT LIBRARY

' RETURNS: TRUE IF SUCCESSFUL, FALSE OTHERWISE
'*************************************************************


Dim oOutlook As Outlook.Application
Dim oNs As Outlook.NameSpace
Dim oFldr As Outlook.MAPIFolder
Dim oMessage As Object
Dim sPathName As String
Dim oAttachment As Outlook.Attachment
Dim iCtr As Integer
Dim iAttachCnt As Integer

On Error GoTo ErrHandler

If PathName = "" Then
sPathName = GetTempDir
Else
sPathName = PathName
End If

If Right(sPathName, 1) <> "\" Then sPathName = sPathName & "\"
If Dir(sPathName, vbDirectory) = "" Then Exit Function

Set oOutlook = New Outlook.Application
Set oNs = oOutlook.GetNamespace("MAPI")
Set oFldr = oNs.GetDefaultFolder(olFolderInbox)
For Each oMessage In oFldr.Items
With oMessage.Attachments
iAttachCnt = .Count
If iAttachCnt > 0 Then
For iCtr = 1 To iAttachCnt
.Item(iCtr).SaveAsFile sPathName _
& .Item(iCtr).FileName
Next iCtr
End If
End With
DoEvents

Next oMessage
SaveAttachments = True

ErrHandler:
Set oMessage = Nothing
Set oFldr = Nothing
Set oNs = Nothing
Set oOutlook = Nothing
End Function



you're basically going to need to find some properties collection (on
some outlook object)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top