C
Casey
I am helping a friend update his contact information from an Access
application into Business Contact Manager. The existing app has a comments
column which is defined as memo and some of his entry have a size that
exceeds the limits of the comment field in outlook. The dicision was to
create word documents from these comments (this task I have completed) and
then add them to the Business History folder in BCM. I am having problems
with this part of the task.
Here is what I have that is not working.
Function foo2()
Dim objNS As NameSpace
Dim objFR(0 To 1) As Object
Dim objCN As ContactItem
Dim objJN As JournalItem
Dim objOB As Object
Dim objLNS As Links
Dim objLN As Link
Dim liX As Integer
Set objNS = Outlook.Application.GetNamespace("MAPI")
Set objFR(0) = objNS.Folders(2).Folders(1)
Set objFR(1) = objNS.Folders(2).Folders(4)
For liX = 1 To objFR(0).Items.Count
If objFR(0).Items(liX).Class = olContact Then
Set objCN = objFR(0).Items(liX)
Set objJN = objFR(1).Items.Add(olJournalItem)
Set objLNS = objJN.Links
Set objOB = objCN
objJN.Body = "File: " & objCN.FirstName & " " & objCN.LastName &
".doc"
Set objLN = objLNS.Add(objCN)
objJN.Attachments.Add "C:\Documents and Settings\Clever\My
Documents\Access Files\" & _
objCN.LastName & ", " & objCN.FirstName &
".doc", olByReference
'objJN.Save
'objJN.Close olSave
End If
Next
Set objNS = Nothing
Set objCN = Nothing
Set objJN = Nothing
Set objFR(0) = Nothing
Set objFR(1) = Nothing
End Function
Note:
These do not work in BCM
'objJN.Save
'objJN.Close olSave
thanks in advance
Casey
application into Business Contact Manager. The existing app has a comments
column which is defined as memo and some of his entry have a size that
exceeds the limits of the comment field in outlook. The dicision was to
create word documents from these comments (this task I have completed) and
then add them to the Business History folder in BCM. I am having problems
with this part of the task.
Here is what I have that is not working.
Function foo2()
Dim objNS As NameSpace
Dim objFR(0 To 1) As Object
Dim objCN As ContactItem
Dim objJN As JournalItem
Dim objOB As Object
Dim objLNS As Links
Dim objLN As Link
Dim liX As Integer
Set objNS = Outlook.Application.GetNamespace("MAPI")
Set objFR(0) = objNS.Folders(2).Folders(1)
Set objFR(1) = objNS.Folders(2).Folders(4)
For liX = 1 To objFR(0).Items.Count
If objFR(0).Items(liX).Class = olContact Then
Set objCN = objFR(0).Items(liX)
Set objJN = objFR(1).Items.Add(olJournalItem)
Set objLNS = objJN.Links
Set objOB = objCN
objJN.Body = "File: " & objCN.FirstName & " " & objCN.LastName &
".doc"
Set objLN = objLNS.Add(objCN)
objJN.Attachments.Add "C:\Documents and Settings\Clever\My
Documents\Access Files\" & _
objCN.LastName & ", " & objCN.FirstName &
".doc", olByReference
'objJN.Save
'objJN.Close olSave
End If
Next
Set objNS = Nothing
Set objCN = Nothing
Set objJN = Nothing
Set objFR(0) = Nothing
Set objFR(1) = Nothing
End Function
Note:
These do not work in BCM
'objJN.Save
'objJN.Close olSave
thanks in advance
Casey