Solved

How to import account data from current email client into mine?

Posted on 2004-10-19
3
160 Views
Last Modified: 2010-05-02
Hi,

I'm writing an email client and would like to know how to import account data (friendly name, server name, user name, password...) from existing account(s) into my client.  I've seen this done with other email programs.  Code would be great.

Thanks, QS
0
Comment
Question by:QuantumSingularity
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
jimbobmcgee earned 250 total points
ID: 12357022
A couple of pointers for importing Outlook settings.  The following will take some of the more simple settings (address, name, etc) for the current Outlook user:

    Sub SessionSettings()
   
        Dim myOL As Outlook.Application
       
        Set myOL = New Outlook.Application
       
        With Form1.Text1
           
            'Current User Properties
            .Text = .Text & "CU-Address: " & myOL.Session.CurrentUser.Address & vbCrLf
            .Text = .Text & "CU-AddrEntry: " & myOL.Session.CurrentUser.AddressEntry & vbCrLf
            .Text = .Text & "CU-Class: " & myOL.Session.CurrentUser.Class & vbCrLf
            .Text = .Text & "CU-EntrID: " & myOL.Session.CurrentUser.EntryID & vbCrLf
            .Text = .Text & "CU-Name: " & myOL.Session.CurrentUser.Name & vbCrLf
            .Text = .Text & "CU-Type: " & myOL.Session.CurrentUser.Type & vbCrLf

        End With

        Set myOL = Nothing
           
    End Sub


The following will enumerate the addresses stored in all address lists (for a Contacts item, perhaps):

    Sub Addresses()
   
        Dim myOL As Outlook.Application
        Dim myAL As AddressList
        Dim myAE As AddressEntry
       
        Set myOL = New Outlook.Application
       
        With Form1.Text1
           
            For Each myAL In myOL.Session.AddressLists
               
                .Text = .Text & vbCrLf & myAL.Name & ": (" & myAL.AddressEntries.Count & ")" & vbCrLf
                For Each myAE In myAL.AddressEntries
                   
                   .Text = .Text & vbTab & myAE.Address & vbCrLf
                   
                Next myAE
               
            Next myAL
               
        End With

        Set myOL = Nothing
   
    End Sub


I guess you'd have to do some searching around the Outlook.Application object for the other settings...

HTH.

J.
0
 
LVL 16

Expert Comment

by:jimbobmcgee
ID: 12357032
BTW, the above code snippets require a form (Form1) with a text box (Text1), set to Multiline = True, WordWrap = False and ScrollBars ~ Both.

J.
0
 

Author Comment

by:QuantumSingularity
ID: 12362165
jimbob,
Looks promising.  Unfortunately we don't have Outlook on any of our machines to test/expand the code.  I guess I'm more interested if extracting the data from Outlook Express.  Any ideas there?

QS
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question