Good Morning Sue,
Here is the link to the sample I am experimenting with:
http://www.microsoft.com/downloads/d...displaylang=en
and here is some of the code I am put together:
1 private void ThisAddIn_Startup(object sender, System.EventArgs e)
2 {
3 Outlook.MAPIFolder customPropFolder =
CustomPropertiesFolder(this.Application.Session);
4
5 if (customPropFolder != null)
6 {
7 customPropFolder.WebViewURL =
RegisterFolderHomepage.RegisterType(typeof(FolderH omepageUC),
customPropFolder.Name);
8 customPropFolder.WebViewOn = true;
9 customPropFolder.Display();
10 }
11 }
12
13 private Outlook.MAPIFolder CustomPropertiesFolder(Outlook.NameSpace
session)
15 {
16 string folderName = "Special Folder";
17 Outlook.MAPIFolder rootFolder =
(Outlook.MAPIFolder)session.GetDefaultFolder(Outlo ok.OlDefaultFolders.olFolderInbox).Parent;
18 Outlook.MAPIFolder customPropFolder = null;
19 foreach (Outlook.MAPIFolder _folder in rootFolder.Folders)
20 {
21 if (_folder.Name == folderName)
22 customPropFolder = _folder;
23 }
24
25 try
26 {
27 if (customPropFolder == null)
28 {
29 customPropFolder = rootFolder.Folders.Add(folderName,
Outlook.OlDefaultFolders.olFolderInbox);
30 }
31 }
32 catch (Exception ex)
33 {
34 System.Windows.Forms.MessageBox.Show(ex.Message);
35 }
36
37 return customPropFolder;
38 }
All I am doing to the sample (at the link provided above) is changing the
occurrences of "Outlook.OlDefaultFolders.olFolderTasks" to
"Outlook.OlDefaultFolders.olFolderInbox". Before the change, the sample works
fine, but after the change it breaks.
If I can get the sample to behave properly, my problem (to add a folder
with a custom homepage to the root folder) would be solved.
As to your second question, I was wandering if the following would be
possible:
• Can an ASP.Net page sense its outlook browser environment, and based on
that be able to open inspectors and change MailItem properties before item is
sent?
A custom task pane is definitely one of the options I have considered, but a
custom explorer window (AKA, folder home page) is much more effective and, in
my opinion, a better design. Of course it is more challenging.
I am open to suggestions, suggestions I can hopefully code.
Thank you so much for your time and effort.
"Sue Mosher [MVP-Outlook]" wrote:
1) You get an error on what statement? Show enough of the code that people who might respond can know what you code you're working with.
2) Exchange parameters in what way?
It might help if you explained why you think a folder home page is a good solution, instead of a custom task pane.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"Naji" wrote in message ...
Hello everyone,
Thank you for your assistance.
I am using VS 2008 and Outlook 2007
Please advise as to the best way to achieve the following:
1) I want to be able to click on a button that resides in the Explorer
Toolbar, and display a custom explorer window with different controls.
I have already tried to follow the steps outlined in this sample:
"OutlookAddin_FolderHomepageView_Sample", but, in my case, it seems to work
only for the Tasks Folder, but it would not work for the Default Inbox
folder. I keep getting: "Object does not support this property or method"
2) Can a web page that is showing inside Outlook browser exchange
parameters with the outlook explorer that is showing that page?
thank you.