? for Sue M

G

Guest

I have a macro that I have used for weeks now without any issues. Today,
when I run it, I get the following error:

Run-time error '-2147221233(8004010f)':
[Collaboration Data Objects-[MAPI_E_NOT_FOUND(8004010F]]

This macro is designed to sweep a specific mailbox in outlook and saves a
copy of the attachment to a different location; where they are processed
later in the macro. There is a lot of code but I I have included a portion
where the error occurs.........................

Set objSession = CreateObject("MAPI.Session")
objSession.Logon "", "", False, False, 0
Set objfolder1 = myitem.Parent
Set objMessage = objSession.GetMessage(myitem.EntryID, objfolder1.StoreID)
Set objsender = objMessage.Sender
Set objFields = objsender.fields

the macro errors out on the next line:

Set objField = objFields.Item(CdoPR_Office_Location)

It appears to me that e-mails are being sent "differently" to the folder we
are using. In the past, objsender would provide the e-mail sender's name and
then objFields got filled. I used objField to get the person's profit
center(e.g. 7777/10050023). This is then checked against another variable.

However, today, when I look at objsender, it is filled with a long string
that doesn;t look anything like it did in the past. Any suggestions would be
greatly appreciated to fix this issue. Thanks for the help.
 
S

Sue Mosher [MVP-Outlook]

Particular CDO fields don't have to exist on all objects. Include an On Error Resume Next statement to allow you to handle the error like this:

Set objField = objFields.Item(CdoPR_Office_Location)
If Not objField Is Nothing Then
' it's safe to work with objField
End If

Sender is a CDO AddressEntry object, so just looking at the object you'll see the default property, which I think is Name. --
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Thanks..........I'll take a look. Thanks again.......
--
JT


Sue Mosher said:
Particular CDO fields don't have to exist on all objects. Include an On Error Resume Next statement to allow you to handle the error like this:

Set objField = objFields.Item(CdoPR_Office_Location)
If Not objField Is Nothing Then
' it's safe to work with objField
End If

Sender is a CDO AddressEntry object, so just looking at the object you'll see the default property, which I think is Name. --
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



JT said:
I have a macro that I have used for weeks now without any issues. Today,
when I run it, I get the following error:

Run-time error '-2147221233(8004010f)':
[Collaboration Data Objects-[MAPI_E_NOT_FOUND(8004010F]]

This macro is designed to sweep a specific mailbox in outlook and saves a
copy of the attachment to a different location; where they are processed
later in the macro. There is a lot of code but I I have included a portion
where the error occurs.........................

Set objSession = CreateObject("MAPI.Session")
objSession.Logon "", "", False, False, 0
Set objfolder1 = myitem.Parent
Set objMessage = objSession.GetMessage(myitem.EntryID, objfolder1.StoreID)
Set objsender = objMessage.Sender
Set objFields = objsender.fields

the macro errors out on the next line:

Set objField = objFields.Item(CdoPR_Office_Location)

It appears to me that e-mails are being sent "differently" to the folder we
are using. In the past, objsender would provide the e-mail sender's name and
then objFields got filled. I used objField to get the person's profit
center(e.g. 7777/10050023). This is then checked against another variable.

However, today, when I look at objsender, it is filled with a long string
that doesn;t look anything like it did in the past. Any suggestions would be
greatly appreciated to fix this issue. Thanks for the help.
 

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