Announcement

Collapse
No announcement yet.

Script on outlook add-on

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script on outlook add-on

    Hello,

    I really need help on writing a script to create folders and subfolders on users outlook. i have never done this before.

  • #2
    Re: Script on outlook add-on

    This can be done using VBScript... aka VBA, VB for Applications.

    From Experts Exchange:
    http://www.experts-exchange.com/Appl..._21916673.html
    Code:
    Sub CreateYearlyPST(strYear As String, strArchiveFileName As String)
        Dim olkNS As Outlook.NameSpace, _
            olkFolder As Outlook.MAPIFolder
        'Create a NameSpace object
        Set olkNS = Application.GetNamespace("MAPI")
        'Create the new PST file using the name passed
        olkNS.AddStore strArchiveFileName
        'Get the root folder in the new PST file.  OpenMAPIFolder is a custom function.  I can post the code if you need.
        Set olkFolder = OpenMAPIFolder("\Personal Folders")
        'Create a fodler called Inbox
        olkFolder.Folders.Add "Inbox", olFolderInbox
        olkFolder.Name = strYear
        olkNS.RemoveStore olkFolder
        Set olkFolder = Nothing
        Set olkNS = Nothing
    End Sub
    Andrew

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Re: Script on outlook add-on

      Thanks Ahinson, for all your help. I do really appreciate ur help.

      Comment

      Working...
      X