A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook View Control Folder property



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 25th 08, 02:30 PM posted to microsoft.public.outlook.program_addins
Nency
external usenet poster
 
Posts: 1
Default Outlook View Control Folder property

Hi all,

I am trying to make an Outlook 2003 add-in using Visual Studio 2008 on
Windows XP SP3.

My add-in is using custom Folder Home Page which displays my custom form,
which wraps Outlook View Control.

When I try to set Folder property of the OVC, I get COM Exception with
'Unknown Error' description every time. I am using value of the
CurrentFolder.FolderPath property of the active explorer:

Outlook.Explorer currentExplorer = app.ActiveExplorer();
if (currentExplorer != null)
{
ovcWrapper.Folder = currentExplorer.CurrentFolder.FolderPath;
}
Folder is located in non-default PST file.

I must underline that everything worked just fine before I went to holiday .

Thanks,

Nenad
Ads
  #2  
Old October 2nd 08, 01:44 PM posted to microsoft.public.outlook.program_addins
Nenad Dobrilovic
external usenet poster
 
Posts: 10
Default Outlook View Control Folder property

After a while, I finally find out what was the problem: name of the external
storage cannot be 'Documents' .

During startup of the addin, it loads the non-default PST file, and changes
its name (not the name of the pst file, but the name of the root folder) to
"Documents". Well, it was allowed before, but now it is not - Outlook View
Control throws an exception when you try to set a Folder property.

This is lines of code which caused a problem:

session.AddStore("C:\\test.pst"); // loads existing or creates a new one, if
there is none.
storage = session.Folders.GetLast(); // grabs root folder of the new
fileStorage.

if (storage.Name != storageName) // if fileStorage is brand new, it has
default name.
{
storage.Name = "Documents";
session.RemoveStore(storage); // to apply new fileStorage name, it
have to be removed and added again.
session.AddStore(storagePath);
}
--
Nenad Dobrilovic


"Nency" wrote:

Hi all,

I am trying to make an Outlook 2003 add-in using Visual Studio 2008 on
Windows XP SP3.

My add-in is using custom Folder Home Page which displays my custom form,
which wraps Outlook View Control.

When I try to set Folder property of the OVC, I get COM Exception with
'Unknown Error' description every time. I am using value of the
CurrentFolder.FolderPath property of the active explorer:

Outlook.Explorer currentExplorer = app.ActiveExplorer();
if (currentExplorer != null)
{
ovcWrapper.Folder = currentExplorer.CurrentFolder.FolderPath;
}
Folder is located in non-default PST file.

I must underline that everything worked just fine before I went to holiday .

Thanks,

Nenad

  #3  
Old October 6th 08, 12:34 PM posted to microsoft.public.outlook.program_addins
Nenad Dobrilovic
external usenet poster
 
Posts: 10
Default Outlook View Control Folder property

I have some clarification regarding my solution to the issue. Problem is not
in the specific name of the storage (I mentioned "Documents") but in the fact
that, for some reason, any name of the storage become a problem.

When I change a name of the external storage (see code above) to be some
new, everything works fine for some time, but than suddenly, unknown COM
exception shows up. Than, I change a name of the storage to be something new
(not 'Documents' but 'Test' for example) and everything works fine again for
some time.
--
Nenad Dobrilovic


"Nenad Dobrilovic" wrote:

After a while, I finally find out what was the problem: name of the external
storage cannot be 'Documents' .

During startup of the addin, it loads the non-default PST file, and changes
its name (not the name of the pst file, but the name of the root folder) to
"Documents". Well, it was allowed before, but now it is not - Outlook View
Control throws an exception when you try to set a Folder property.

This is lines of code which caused a problem:

session.AddStore("C:\\test.pst"); // loads existing or creates a new one, if
there is none.
storage = session.Folders.GetLast(); // grabs root folder of the new
fileStorage.

if (storage.Name != storageName) // if fileStorage is brand new, it has
default name.
{
storage.Name = "Documents";
session.RemoveStore(storage); // to apply new fileStorage name, it
have to be removed and added again.
session.AddStore(storagePath);
}
--
Nenad Dobrilovic


"Nency" wrote:

Hi all,

I am trying to make an Outlook 2003 add-in using Visual Studio 2008 on
Windows XP SP3.

My add-in is using custom Folder Home Page which displays my custom form,
which wraps Outlook View Control.

When I try to set Folder property of the OVC, I get COM Exception with
'Unknown Error' description every time. I am using value of the
CurrentFolder.FolderPath property of the active explorer:

Outlook.Explorer currentExplorer = app.ActiveExplorer();
if (currentExplorer != null)
{
ovcWrapper.Folder = currentExplorer.CurrentFolder.FolderPath;
}
Folder is located in non-default PST file.

I must underline that everything worked just fine before I went to holiday .

Thanks,

Nenad

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing Folder View with Custom Control DaveR Add-ins for Outlook 0 November 14th 07 06:33 PM
Outlook View Control Joel Allen Outlook and VBA 5 July 9th 07 11:10 PM
Outlook View Control embedded in custom control [email protected] Outlook - General Queries 1 November 8th 06 11:41 AM
Outlook View Control embedded in custom control [email protected] Outlook - Using Forms 1 November 8th 06 11:41 AM
Changing property of control to all caps Russ Outlook - Using Forms 10 June 29th 06 04:21 PM


All times are GMT +1. The time now is 09:48 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-2025 Outlook Banter.
The comments are property of their posters.