Get Outlook Contacts

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

Locked
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Get Outlook Contacts

Post by David de Argentina »

Save as Outlook Contacts
Modify and use as your own.

[syntax=vb]dim objOutlook
dim objNamespace
dim ContactFolder
dim currentItem
dim Report
dim i

On Error Resume Next

Const olFolderContacts = 10

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set ContactFolder = objNamespace.GetDefaultFolder(olFolderContacts)

for i = 1 to ContactFolder.Items.Count
Set currentContact = ContactFolder.Items(i)

Report = Report & "|" & currentContact.FullName
Report = Report & "|" & currentContact.Account
'Report = Report & currentContact.Anniversary
'Report = Report & currentContact.AssistantName
'Report = Report & currentContact.AssistantTelephoneNumber
'Report = Report & currentContact.BillingInformation
'Report = Report & currentContact.Birthday
'Report = Report & currentContact.Body
Report = Report & "|" & currentContact.Business2TelephoneNumber
'Report = Report & currentContact.BusinessAddress
'Report = Report & currentContact.BusinessAddressCity
'Report = Report & currentContact.BusinessAddressCountry
'Report = Report & currentContact.BusinessAddressPostalCode
'Report = Report & currentContact.BusinessAddressPostOfficeBox
'Report = Report & currentContact.BusinessAddressState
'Report = Report & currentContact.BusinessAddressStreet
'Report = Report & currentContact.BusinessCardLayoutXml
'Report = Report & currentContact.BusinessCardType
'Report = Report & currentContact.BusinessFaxNumber
'Report = Report & currentContact.BusinessHomePage
'Report = Report & currentContact.BusinessTelephoneNumber
Report = Report & "|" & currentContact.CallbackTelephoneNumber
'Report = Report & currentContact.CarTelephoneNumber
'Report = Report & currentContact.Categories
'Report = Report & currentContact.Children
'Report = Report & currentContact.Companies
'Report = Report & currentContact.CompanyAndFullName
'Report = Report & currentContact.CompanyLastFirstNoSpace
'Report = Report & currentContact.CompanyLastFirstSpaceOnly
'Report = Report & currentContact.CompanyMainTelephoneNumber
'Report = Report & currentContact.CompanyName
'Report = Report & currentContact.ComputerNetworkName
'Report = Report & currentContact.ConversationIndex
'Report = Report & currentContact.ConversationTopic
Report = Report & "|" & currentContact.CreationTime
'Report = Report & currentContact.CustomerID
'Report = Report & currentContact.Department
'Report = Report & currentContact.DownloadState
Report = Report & "|" & currentContact.Email1Address
'Report = Report & currentContact.Email1AddressType
'Report = Report & currentContact.Email1DisplayName
'Report = Report & currentContact.Email1EntryID
'Report = Report & currentContact.Email2Address
'Report = Report & currentContact.Email2AddressType
'Report = Report & currentContact.Email2DisplayName
'Report = Report & currentContact.Email2EntryID
'Report = Report & currentContact.Email3Address
'Report = Report & currentContact.Email3AddressType
'Report = Report & currentContact.Email3DisplayName
'Report = Report & currentContact.Email3EntryID
'Report = Report & currentContact.Account
'Report = Report & currentContact.FileAs
'Report = Report & currentContact.FirstName
'Report = Report & currentContact.FTPSite
Report = Report & "|" & currentContact.FullName
'Report = Report & currentContact.FullNameAndCompany
'Report = Report & currentContact.Gender
'Report = Report & currentContact.GovernmentIDNumber
'Report = Report & currentContact.HasPicture
'Report = Report & currentContact.Hobby
'Report = Report & currentContact.Home2TelephoneNumber
'Report = Report & currentContact.HomeAddress
'Report = Report & currentContact.HomeAddressCity
'Report = Report & currentContact.HomeAddressCountry
'Report = Report & currentContact.HomeAddressPostalCode
'Report = Report & currentContact.HomeAddressPostOfficeBox
'Report = Report & currentContact.HomeAddressState
'Report = Report & currentContact.HomeAddressStreet
'Report = Report & currentContact.HomeFaxNumber
'Report = Report & currentContact.HomeTelephoneNumber
'Report = Report & currentContact.IMAddress
'Report = Report & currentContact.Importance
'Report = Report & currentContact.Initials
'Report = Report & currentContact.InternetFreeBusyAddress
'Report = Report & currentContact.IsConflict
'Report = Report & currentContact.ISDNNumber
'Report = Report & currentContact.IsMarkedAsTask
'Report = Report & currentContact.JobTitle
'Report = Report & currentContact.Journal
'Report = Report & currentContact.Language
'Report = Report & currentContact.LastFirstAndSuffix
'Report = Report & currentContact.LastFirstNoSpace
'Report = Report & currentContact.LastFirstNoSpaceAndSuffix
'Report = Report & currentContact.LastFirstNoSpaceCompany
'Report = Report & currentContact.LastFirstSpaceOnly
'Report = Report & currentContact.LastFirstSpaceOnlyCompany
'Report = Report & currentContact.LastModificationTime
'Report = Report & currentContact.LastName
'Report = Report & currentContact.LastNameAndFirstName
'Report = Report & currentContact.Links
'Report = Report & currentContact.MailingAddress
'Report = Report & currentContact.MailingAddressCity
'Report = Report & currentContact.MailingAddressCountry
'Report = Report & currentContact.MailingAddressPostalCode
'Report = Report & currentContact.MailingAddressPostOfficeBox
'Report = Report & currentContact.MailingAddressState
'Report = Report & currentContact.MailingAddressStreet
'Report = Report & currentContact.ManagerName
'Report = Report & currentContact.MarkForDownload
'Report = Report & currentContact.MessageClass
'Report = Report & currentContact.MiddleName
'Report = Report & currentContact.Mileage
Report = Report & "|" & currentContact.MobileTelephoneNumber
'Report = Report & currentContact.NetMeetingAlias
'Report = Report & currentContact.NetMeetingServer
'Report = Report & currentContact.NickName
'Report = Report & currentContact.NoAging
'Report = Report & currentContact.OfficeLocation
'Report = Report & currentContact.OrganizationalIDNumber
'Report = Report & currentContact.OtherAddress
'Report = Report & currentContact.OtherAddressCity
'Report = Report & currentContact.OtherAddressCountry
'Report = Report & currentContact.OtherAddressPostalCode
'Report = Report & currentContact.OtherAddressPostOfficeBox
'Report = Report & currentContact.OtherAddressState
'Report = Report & currentContact.OtherAddressStreet
'Report = Report & currentContact.OtherFaxNumber
'Report = Report & currentContact.OtherTelephoneNumber
'Report = Report & currentContact.OutlookInternalVersion
'Report = Report & currentContact.OutlookVersion
'Report = Report & currentContact.PagerNumber
'Report = Report & currentContact.PersonalHomePage
'Report = Report & currentContact.PrimaryTelephoneNumber
'Report = Report & currentContact.Profession
'Report = Report & currentContact.RadioTelephoneNumber
'Report = Report & currentContact.ReferredBy
'Report = Report & currentContact.ReminderOverrideDefault
'Report = Report & currentContact.ReminderPlaySound
'Report = Report & currentContact.ReminderSet
'Report = Report & currentContact.ReminderSoundFile
'Report = Report & currentContact.ReminderTime
'Report = Report & currentContact.Saved
'Report = Report & currentContact.SelectedMailingAddress
'Report = Report & currentContact.Sensitivity
'Report = Report & currentContact.Size
'Report = Report & currentContact.Spouse
'Report = Report & currentContact.Subject
'Report = Report & currentContact.Suffix
'Report = Report & currentContact.TaskCompletedDate
'Report = Report & currentContact.TaskDueDate
'Report = Report & currentContact.TaskStartDate
'Report = Report & currentContact.TaskSubject
'Report = Report & currentContact.TelexNumber
'Report = Report & currentContact.Title
'Report = Report & currentContact.ToDoTaskOrdinal
'Report = Report & currentContact.TTYTDDTelephoneNumber
'Report = Report & currentContact.UnRead
'Report = Report & currentContact.User1
'Report = Report & currentContact.User2
'Report = Report & currentContact.User3
'Report = Report & currentContact.User4
'Report = Report & currentContact.WebPage
'Report = Report & currentContact.YomiCompanyName
'Report = Report & currentContact.YomiFirstName
'Report = Report & currentContact.YomiLastName
Report = Report & vbCrLf & vbCrLf
Next

set objOutlook = nothing
publication.nbSetVar "[Result]", Report[/syntax]

My defaulted cent,
David de Argentina
Locked