Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-10-19
3
Medium Priority
?
167 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
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
jimbobmcgee earned 750 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

971 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