Solved

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

Posted on 2004-10-19
3
158 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

749 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