CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 1999
    Location
    Asia, Pakistan,Karachi
    Posts
    5

    How to read mail from Outlook Express InBox folder



    Hi,

    Can some one guide me how can i read mail from Outlook Express Inbox folder.

    I had experience of getting mail using POP3 and MAPI.

    Is it different for Outlook and Netscape Mail Client.

    Thanks.

    Sajid.

  2. #2
    Join Date
    Mar 1999
    Posts
    2

    Re: How to read mail from Outlook Express InBox folder



    Hi,


    I have been searching the InterNet to get info about that.

    I found many samples for VB, I wanted some for VC++.


    What I found out is that it is possible through OutLook automation.


    Here is one of the VB Samples that I found :


    The FillFolderCombo and FillMailboxCombo subroutines are very similar. They work by opening a connection to Outlook and populating the combos with the names of folders. When a user has access to other Mailboxes, they are treated as top level folders within Outlook. FillFolderCombo accesses the subfolders of the specified Mailbox and populates the Folder combo with them.


    Private Sub FillFolderCombo()

    On Error GoTo Err_Folder

    ' 'Put the names of all available folders in the folderCombo



    Dim myOlApp As Object

    Dim olNamespace As Object

    Dim iCount As Integer

    Dim mystr As String




    Set myOlApp = CreateObject("Outlook.Application")

    Set olNamespace = myOlApp.GetNameSpace("MAPI")



    iCount = 1

    FolderCombo.Clear

    mystr = MailboxCombo



    While iCount <= olNamespace.folders(mystr).folders.Count

    FolderCombo.AddItem olNamespace.folders(mystr).folders(iCount).Name

    iCount = iCount + 1

    Wend



    Exit Sub

    Err_Folder:

    MsgBox "Unable to resolve mailbox"

    End Sub



    Private Sub FillMailboxCombo()

    '--Fill in all the names of available mailboxes



    Dim myOlApp As Object

    Dim olNamespace As Object

    Dim iCount As Integer



    Set myOlApp = CreateObject("Outlook.Application")

    Set olNamespace = myOlApp.GetNameSpace("MAPI")



    iCount = 1

    MailboxCombo.Clear

    While iCount <= olNamespace.folders.Count

    MailboxCombo.AddItem olNamespace.folders(iCount).Name

    iCount = iCount + 1

    Wend

    End Sub


    Please let me know if you got any information about that.


    Abdulrahman



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured