Exception from HRESULT

L

Laks

Hi,

I have an Outlook Add-In that modifies views. This add-in directly
manipulates the view XML and then saves the view.

On one particular machine, what happens when the add-in tries to save
the view, I get the following exception... again and again....

Exception from HRESULT: 0xAF604005., Exception from HRESULT:
0xBDC04005. and so on...... I seriously do not know what's going wrong
here.... because this add-in works like a charm on all other
machines.....

Help greatly appreciated......

Thanks and Regards,
Laks
 
L

Laks

Hi,

I forgot to mention that I am using VS .NET 2003, OL2003. And also that
I am getting a different number with the HRESULT each time, for the
saem save...

I scan all global mail and post views, reset autogroup and save them.
Also, I am iterating thtough all the folders, getting all folder
specific views and resetting autogrouping in them and saving it.

Here's the code that I am using

// Global views

foreach(Microsoft.Office.Interop.Outlook.View objView in views) {
if(objView.SaveOption ==
OlViewSaveOption.olViewSaveOptionAllFoldersOfType) {
objView.XML = objView.XML.Replace("<autogroup>1</autogroup>",
"<autogroup>0</autogroup>");
try {
objView.Save();
} catch (System.Exception ex) {
// Here's where I am getting the HRESULT....
}
}
}

// Folder specific views
private void IterateFolders (Folders folders) {
foreach(MAPIFolder folder in folders) {
if(folder.Name.CompareTo("Public Folders")!= 0) {
Views views = folder.Views;
foreach(Microsoft.Office.Interop.Outlook.View objView in
views) {
objView.XML =
objView.XML.Replace("<autogroup>1</autogroup>",
"<autogroup>0</autogroup>");
try {
objView.Save();
} catch(System.Exception ex) {
// Here's where I am getting the HRESULT....
}
} // end of foreach views
} // end of IF
IterateFolders(folder.Folders); // recurse here
}
}

This error is occurring repeatdly and consistently with a particular
profile and is fine on all other profiles.... this particular profile
contains a huge number of folders (of the order of 600 - 700)....

Also a 'Microsoft Outlook: Operation Failed' COMException occurs for
this particular profile whenever I try and iterate the complete folder
list in a manner illestrated above...

Thanks in Advance,
Laks
 

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