![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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 |
#2
|
|||
|
|||
![]()
If the folder is selected use ActiveExplorer.CurrentFolder.Items and iterate
the Items collection. Be aware that Distribution Lists may also be there so test for the correct message class and handle any errors for DL's. If not selected then use NameSpace.GetDefaultFolder(olFolderContacts) to get the Contacts folder and then use its Items collection. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Michael Anderson" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Duplicate Contact Detection Outlook 2003 Custom Form | [email protected] | Outlook - Using Contacts | 1 | March 20th 06 03:02 PM |
Custom Contact Form does not update fields until Outlook is closed | Rick | Outlook - Using Forms | 0 | February 21st 06 11:41 PM |
Importing in to Custom Contact Form | Mark the Outlook Idiot | Outlook - Using Contacts | 1 | February 6th 06 09:53 PM |
Need method similar to GotFocus for customised Contact form | Michael Anderson | Outlook - Using Forms | 0 | January 24th 06 11:11 PM |
Customised Contact Form not being published properly | Michael Anderson | Outlook - Using Forms | 0 | January 24th 06 08:10 PM |