[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Export Exchange Public Folder Data to CSV

Posted on 2008-10-01
5
Medium Priority
?
690 Views
Last Modified: 2013-11-25
My client has created several custom forms through outllook on their exchange database (exchange 2000 public folders). They have added extra detail fields. I need to get all this information out of exchange and into a CSV, XML or any other transferrable format to import into an application we are developing for them.

Does anyone know of a simple way to do do this?
0
Comment
Question by:mansol2
[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
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 22629896
Hi, mansol2.

Assuming that the data from the additional fields is being stored in user-properties, then I can do this with a simple bit of scripting.  Do you want just the custom fields or are there stock fields you want too?


0
 

Author Comment

by:mansol2
ID: 22631620
Bluedevilfan

I am looking for the stock fields too. Could you give me a couple of pointers or some sample script and I will try to do it myself.

Thanks

0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 22634852
Here's an export routine I wrote for another question.  This one exports appointments.  I've added comments to help you understand how it works.  Stock fields are referred to by their property name.  For example, an appointment item's starting time is in a property called Start.  Built-in properties are all documented in online help for the particular object type (i.e. message, task, appointment, etc.).  User-properties are stored in a collection called UserProperties.  Use code like this to get the value of a userproperty:

    varValue = Item.UserProperties.Item("MyUserPropertyName").Value

Where
varValue is a variable to hold the returned value
Item is any Outlook object (e.g. message, task, appointment, etc.)
MyUserPropertyName is the name of the property to be retrieved


Sub ExportAppointments()
    Const S1 = """"
    Const S2 = ""","""
    Dim olkItems As Outlook.Items, _
        olkAppt As Outlook.AppointmentItem, _
        objFSO As Object, _
        objFile As Object, _
        varBuffer As Variant
    'Open the folder that's currently selected in Outlook.  This makes the routine more flexible than opening a specific folder.'
    Set olkItems = Application.ActiveExplorer.CurrentFolder.Items
    'Loop to process each item in the folder.'
    For Each olkAppt In olkItems
        'Test to make sure that the item is of the desired type.'
        If olkAppt.Class = olAppointment Then
            With olkAppt
                'Build a CSV row for the current record.  The appointment fields are all stock fields.'
                varBuffer = varBuffer & S1 & .Subject & S2 & .Body & S2 & .Start & S2 & .End _
                    & S2 & .AllDayEvent & S1 & vbCrLf
            End With
        End If
    Next
    'Create a file and write the CSV data to it.'
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.CreateTextFile("C:\eeTesting\Calendar - " & olkItems.Parent.Parent.Name & ".csv")
    objFile.WriteLine varBuffer
    'Clean-up'
    objFile.Close
    Set objFile = Nothing
    Set objFSO = Nothing
    Set olkAppt = Nothing
    Set olkItems = Nothing
    MsgBox "All done!", vbInformation + vbOKOnly, "Export Appointments"
End Sub

Open in new window

0
 

Author Closing Comment

by:mansol2
ID: 31502274
Nice and clear - took me right back to my cBasic days - when 64K was enough memory to run an accounts program !!!
Thanks
0
 
LVL 76

Expert Comment

by:David Lee
ID: 22644073
You're welcome.  Glad I could help out.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
On September 18, Experts Exchange launched the first installment of the Help Bell, a new feature for Premium Members, Team Accounts, and Qualified Experts. The Help Bell will serve as an additional tool to help teams increase question visibility.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

649 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