Technology computers-hardware

How to Create a Folder Using the Microsoft Outlook Object Library

    • 1). Create a new folder using the C# code example below:

      Outlook._Application oApplication = new Outlook.ApplicationClass();
      Outlook._NameSpace oNamespace = oApplication.GetNamespace("MAPI");
      Outlook.MAPIFolder oInbox = oNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
      Outlook.Folders oFolders = oInbox .Folders;
      Outlook.MAPIFolder oPersonal = oFolders.Add("Personal Messages");

    • 2). Add a folder with Visual Basic for Applications (VBA) by copying the following code:

      Dim oNamespace As Outlook.NameSpace
      Dim oInbox As Outlook.Folder
      Dim oNewFolder As Outlook.Folder

      Set oNamespace = Application.GetNamespace("MAPI")
      Set oInbox = oNamespace.GetDefaultFolder(olFolderInbox)
      Set oNewFolder = myFolder.Folders.Add("New Folder")

    • 3). Create an additional Outlook folder with VB.NET by using the following code:

      Dim oOutlook As Outlook._Application
      oOutlook = New Outlook.Application()
      Dim oNamespace As Outlook._NameSpace = oOutlook.Session
      Dim oInbox As Outlook.MAPIFolder = oNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
      Dim oNewFolder As Outlook.MAPIFolder = oInbox.Folders.Add("Personal Folder")

Related posts "Technology : computers-hardware"

Innovative And Economical Vxa Tape Technology

Hardware

How to Save a Document to a Flash Drive From Open Office

Hardware

NAS vs DAS, Which Is Better And Why?

Hardware

How to Flash BIOS on a Acer Aspire 5517 Laptop

Hardware

Jet Tec Canon Pg510 And Cl511 Ink Cartridges From Uk Ink Supplies

Hardware

How do I Hook Up My 3M X55i Projector to My Computer?

Hardware

How to Conduct Remote Management of an HP Laserjet 4050

Hardware

How to Copy Games to a Hard Drive

Hardware

How to Hide Windows System Tray Icons

Hardware

Leave a Comment