View Single Post
  #1  
Old February 4th 06, 08:08 PM posted to microsoft.public.outlook.program_vba
Michael Anderson
external usenet poster
 
Posts: 19
Default Get values of custom variables from customised contact form

I am trying to use the Scripting.TextStream aspect of FileSystemObject on a
customised contact form. I want every record in the contacts folder to be
exported as a .csv file at the click of a button.

I have tried instantiating the custom variables "mxzParentCompany", "Last
Name", "mxzVIP" & "BusinessAddressCity" as follows, but this only outputs the
data in the immediate record.

Sub mxzcboExportCurrentRecord_Click()

Dim fso, MyFile
Dim txtmxzParentCompany
Dim txtLastName
Dim txtmxzVIP
Dim txtBusinessAddressCity
Dim objInspector

Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile= fso.CreateTextFile("c:\testfile.txt", True)

Set objInspector = Item.GetInspector

txtmxzParentCompany =
Item.UserProperties_("mxzParentCompany").Value
txtLastName = Item.UserProperties("Last Name").Value
txtmxzVIP = Item.UserProperties("mxzVIP").Value
txtBusinessAddressCity = Item.UserProperties_
("Business Address City").Value
'txtmxzNCRL2 = Item.UserProperties("mxzNCRL2").Value

MyFile.WriteLine(txtmxzParentCompany & " " & txtLastName & " "_ &
txtmxzVIP & " " &_ txtBusinessAddressCity & " ")

MyFile.Close

Set fso = Nothing
Set objInspector = Nothing
Set txtmxzParentCompany = Nothing
Set txtLastName = Nothing
Set txtmxzVIP = Nothing
Set txtBusinessAddressCity = Nothing

End Sub

How can I instantiate the custom variables so that they print out the above
fields from every record in my contact folder?

--
Thank You in Advance,

Michael Anderson
Ads