Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Setting Web View on MAPI Folders

Back to Forum: Tech Off
  • User profile image
    Sathyaish Chakravarthy

    When I create a top level folder and set it's web view on, it works. However, when I create folders under it and set their web view, although the subfolders do get their web URLs in their properties, the little checky that says, "Show home page by default for this folder" is not set on and hence when I click on those folders, they do not navigate to the specified URL.

    Please help. I am using Outlook 2000 on Windows 2000 Pro SP4. I am writing an add-in in VB.NET. Here's line of code:


    fldNew.WebViewOn = True
    fldNew.WebViewURL = STR_DEFAULT_SERVER & nd.Attribute("href").Value
    fldNew.WebViewAllowNavigation = True

  • User profile image
    wacko

    I actually have this working now, but i had to set the webviewon twice for the subfolder in order for it to work. let me go ahead and post the code(sorry its in c#) for what I have. I do apologize for such a long post.

     public void Login()
            {
                Outlook.NameSpace nm;
                Outlook.Folders folders;
                
                Outlook.Explorer exp;
    
                nm = this.GetNamespace("MAPI");
                nm.AddStore("foo.pst");
                fldfoo = nm.Folders.GetLast();
                fldfoo.Name = "foo";
                fldfoo.WebViewOn = true;
                fldfoo.WebViewURL = "http://channel9.msdn.com";
                
    
                exp = this.ActiveExplorer();
                exp.CurrentFolder = fldfoo;
    
                CreateSubs(fldfoo);
                
            }
    
            private void CreateSubs(Microsoft.Office.Interop.Outlook.MAPIFolder fldfoo)
            {
                Outlook.MAPIFolder fldNew = fldfoo.Folders.Add("Test",Outlook.OlDefaultFolders.olFolderInbox);
                fldNew.WebViewURL = "http://www.thewacko.com";
                fldNew.WebViewOn = true;
                webon(fldNew);
                
                
            }
    
            private void webon(Outlook.MAPIFolder folder)
            {
                folder.WebViewOn = true;
            }
    


    This seems to work and sets the subfolder to webviewon = true, I have no clue why it does not work when i initially set it. Maybe you could create the folders first and then set there web props and that would work.

    EDIT: It seems that if you just pass the folders through the webon method and not even set the web stuff initially it does work.  Maybe add them to an arraylist and then pass each of them through the webon method.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.