Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Simple VB Query

Options
  • 14-07-2004 12:12pm
    #1
    Closed Accounts Posts: 537 ✭✭✭


    I currently have this

    Dim myOlFolder As Outlook.MAPIFolders
    Set myOlFolder = myNameSpace.GetDefaultFolder(olFolderInbox)


    how ever i want to change it so that it is like this

    Dim myOlFolder As Outlook.Folders


    DOes anyone know what the second line equivalent is


Comments

  • Closed Accounts Posts: 35 Ivan Dunaev


    try this:

    Dim ol As Outlook.Application
    Set ol = CreateObject("Outlook.Application")

    Dim myFolders As Outlook.Folders
    Dim myNameSpace As Outlook.NameSpace

    Set myNameSpace = ol.GetNamespace("MAPI")
    Set myFolders = myNameSpace.Folders


Advertisement