![]() |
|
Error when working on mailbox vs public folder
Running Outlook 2003 SP2 on Win XP SP2/ Exchange Server 2003
We receive product review requests via email to an Exchange account. Requests are validated manually for certain criteria, which are found within the email. I'm trying to automate that validation process by parsing some dates and numbers in the email. This code is working OK in test, which I'm doing in a public folder where I copied all of the emails to. When I run the code in the mailbox it errors on the final line below: Sub ValidateRequests() Dim objApp As Outlook.Application Dim objFolder As Outlook.MAPIFolder Dim objItem As Object Dim strMsg As String Set objApp = CreateObject("Outlook.Application") Set objFolder = objApp.ActiveExplorer.CurrentFolder For Each objItem In objFolder.Items strMsg = objItem.Body The error is: Thanks for any ideas. Bill Le May |
Error when working on mailbox vs public folder
What type of Object is being retrieved? Look for objItem.Class or something
like TypeName(objItem) or get the MessageClass of the object to see what's going on. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message ... Running Outlook 2003 SP2 on Win XP SP2/ Exchange Server 2003 We receive product review requests via email to an Exchange account. Requests are validated manually for certain criteria, which are found within the email. I'm trying to automate that validation process by parsing some dates and numbers in the email. This code is working OK in test, which I'm doing in a public folder where I copied all of the emails to. When I run the code in the mailbox it errors on the final line below: Sub ValidateRequests() Dim objApp As Outlook.Application Dim objFolder As Outlook.MAPIFolder Dim objItem As Object Dim strMsg As String Set objApp = CreateObject("Outlook.Application") Set objFolder = objApp.ActiveExplorer.CurrentFolder For Each objItem In objFolder.Items strMsg = objItem.Body The error is: Thanks for any ideas. Bill Le May |
Error when working on mailbox vs public folder
A Mail item is being retrieved.
I Googled this error message and got one hit in ...outlook.program_vba, where, in retrospect, I should have posted this question in the first place. The solution there was a permissions issue, which I do not believe to be the case here. I had already given myself godlike privileges to the email box in question. To verify this, I opened a message, performed an Edit Message and successfully saved the changed message. "Ken Slovak - [MVP - Outlook]" wrote in message ... What type of Object is being retrieved? Look for objItem.Class or something like TypeName(objItem) or get the MessageClass of the object to see what's going on. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message ... Running Outlook 2003 SP2 on Win XP SP2/ Exchange Server 2003 We receive product review requests via email to an Exchange account. Requests are validated manually for certain criteria, which are found within the email. I'm trying to automate that validation process by parsing some dates and numbers in the email. This code is working OK in test, which I'm doing in a public folder where I copied all of the emails to. When I run the code in the mailbox it errors on the final line below: Sub ValidateRequests() Dim objApp As Outlook.Application Dim objFolder As Outlook.MAPIFolder Dim objItem As Object Dim strMsg As String Set objApp = CreateObject("Outlook.Application") Set objFolder = objApp.ActiveExplorer.CurrentFolder For Each objItem In objFolder.Items strMsg = objItem.Body The error is: Thanks for any ideas. Bill Le May |
Error when working on mailbox vs public folder
Well, I don't have any answers for you then. Are you positive that you are
getting a valid MAPIFolder object and Items collection? Can you retrieve the Items.Count? It isn't possible that the item could be encrypted or signed is it? -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message ... A Mail item is being retrieved. I Googled this error message and got one hit in ...outlook.program_vba, where, in retrospect, I should have posted this question in the first place. The solution there was a permissions issue, which I do not believe to be the case here. I had already given myself godlike privileges to the email box in question. To verify this, I opened a message, performed an Edit Message and successfully saved the changed message. |
Error when working on mailbox vs public folder
The collection appears to be valid.
The message is a plain text email generated by our website. "Ken Slovak - [MVP - Outlook]" wrote in message ... Well, I don't have any answers for you then. Are you positive that you are getting a valid MAPIFolder object and Items collection? Can you retrieve the Items.Count? It isn't possible that the item could be encrypted or signed is it? -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message ... A Mail item is being retrieved. I Googled this error message and got one hit in ....outlook.program_vba, where, in retrospect, I should have posted this question in the first place. The solution there was a permissions issue, which I do not believe to be the case here. I had already given myself godlike privileges to the email box in question. To verify this, I opened a message, performed an Edit Message and successfully saved the changed message. |
Error when working on mailbox vs public folder
What's the exact error you get, I don't believe you posted it.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message ... The collection appears to be valid. The message is a plain text email generated by our website. |
Error when working on mailbox vs public folder
I did mention it in the original post; here it is again:
"Ken Slovak - [MVP - Outlook]" wrote in message ... What's the exact error you get, I don't believe you posted it. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message ... The collection appears to be valid. The message is a plain text email generated by our website. |
Error when working on mailbox vs public folder
Ah, you posted in HTML, that's why I didn't see it.
MAPI_NOT_FOUND error. Is there an organizational forms library on the server? Have mailboxes been moved? I'd do a google search on MAPI_NOT_FOUND, maybe one of those or other suggestions might help. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message ... I did mention it in the original post; here it is again: |
Error when working on mailbox vs public folder
Yes, I have forms published in the organizational forms library, but these items are not custom forms. No mailboxes have been moved, although I am trying to run this code on another email box, not my own. My rights and permissions for the email box should be sufficient, but I think the fact that it's running on this email box, and not the public folder for which I am owner are the cause of the problem.
"Ken Slovak - [MVP - Outlook]" wrote in message ... Ah, you posted in HTML, that's why I didn't see it. MAPI_NOT_FOUND error. Is there an organizational forms library on the server? Have mailboxes been moved? I'd do a google search on MAPI_NOT_FOUND, maybe one of those or other suggestions might help. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message ... I did mention it in the original post; here it is again: |
Error when working on mailbox vs public folder
Ah, another mailbox not your own. OK. That's a horse of a different color.
See if you can get the folder using NameSpace.GetDefaultFolder(recipient, OlFoldersInbox) where recipient is a Recipient object created with your SMTP email address. From there try the Items collection and iterating it. See if that works. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message ... Yes, I have forms published in the organizational forms library, but these items are not custom forms. No mailboxes have been moved, although I am trying to run this code on another email box, not my own. My rights and permissions for the email box should be sufficient, but I think the fact that it's running on this email box, and not the public folder for which I am owner are the cause of the problem. |
All times are GMT +1. The time now is 10:37 AM. |
|
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com