Create Outlook contacts from APL

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

Create Outlook contacts from APL

Postby HSeguin on Sat Mar 31, 2018 12:15 pm

I would like to that but, if anybody has done it or can share ideas about it, it would be very appreciated!
HSeguin
 
Posts: 8
Joined: Wed Feb 03, 2010 2:43 pm

Re: Create Outlook contacts from APL

Postby Morten|Dyalog on Sun Apr 01, 2018 7:53 am

Bonjour Hubert!

The modern way would be to invoke Powershell or something like that, but that looks a bit complicated compared to the old way. Under the covers I think Powershell just calls the COM objects anyway...

This works on my laptop:

Code: Select all
      'OA' ⎕WC 'OLEClient' 'Outlook.Application'
      ct←OA.CreateItem OA.olContactItem
      ct.(FirstName LastName)←'Donald' 'Duck'
      ct.Save

Of course, there are more properties you can set for an Outlok Contact:

Code: Select all
      ct.⎕nl -2
 Account  Actions  Anniversary  Application  AssistantName  AssistantTelephoneNu
      mber  Attachments  AutoBrowse  AutoResolvedWinner  BillingInformation  Bir
      thday  Body  Business2TelephoneNumber  BusinessAddress  BusinessAddressCit
      y  BusinessAddressCountry  BusinessAddressPostOfficeBox  BusinessAddressPo
      stalCode  BusinessAddressState  BusinessAddressStreet  BusinessCardLayoutX
      ml  BusinessCardType  BusinessFaxNumber  BusinessHomePage  BusinessTelepho
      neNumber  CallbackTelephoneNumber  CarTelephoneNumber  Categories  ChildLi
      st  Children  Class  ClassID  ClassName  Companies  CompanyAndFullName  Co
      mpanyLastFirstNoSpace  CompanyLastFirstSpaceOnly  CompanyMainTelephoneNumb
      er  CompanyName  ComputerNetworkName  Conflicts  ConversationID  Conversat
      ionIndex  ConversationTopic  CreationTime  CustomerID  Data  Department  D
      ownloadState  Email1Address  Email1AddressType  Email1DisplayName  Email1E
      ntryID  Email2Address  Email2AddressType  Email2DisplayName  Email2EntryID
        Email3Address  Email3AddressType  Email3DisplayName  Email3EntryID  Entr
      yID  Event  EventList  FTPSite  FileAs  FirstName  FormDescription  FullNa
      me  FullNameAndCompany  Gender  GetInspector  GovernmentIDNumber  Handle
      HasPicture  HelpFile  Hobby  Home2TelephoneNumber  HomeAddress  HomeAddres
      sCity  HomeAddressCountry  HomeAddressPostOfficeBox  HomeAddressPostalCode
        HomeAddressState  HomeAddressStreet  HomeFaxNumber  HomeTelephoneNumber
       IMAddress  ISDNNumber  Importance  Initials  InstanceMode  InternetFreeBu
      syAddress  IsConflict  IsMarkedAsTask  ItemProperties  JobTitle  Journal
      KeepOnClose  Language  LastError  LastFirstAndSuffix  LastFirstNoSpace  La
      stFirstNoSpaceAndSuffix  LastFirstNoSpaceCompany  LastFirstSpaceOnly  Last
      FirstSpaceOnlyCompany  LastModificationTime  LastName  LastNameAndFirstNam
      e  LateBind  Links  Locale  MAPIOBJECT  MailingAddress  MailingAddressCity
        MailingAddressCountry  MailingAddressPostOfficeBox  MailingAddressPostal
      Code  MailingAddressState  MailingAddressStreet  ManagerName  MarkForDownl
      oad  MessageClass  MethodList  MiddleName  Mileage  MobileTelephoneNumber
       NetMeetingAlias  NetMeetingServer  NickName  NoAging  OfficeLocation  Org
      anizationalIDNumber  OtherAddress  OtherAddressCity  OtherAddressCountry
      OtherAddressPostOfficeBox  OtherAddressPostalCode  OtherAddressState  Othe
      rAddressStreet  OtherFaxNumber  OtherTelephoneNumber  OutlookInternalVersi
      on  OutlookVersion  PagerNumber  Parent  PersonalHomePage  PrimaryTelephon
      eNumber  Profession  PropList  PropertyAccessor  QueueEvents  RTFBody  Rad
      ioTelephoneNumber  ReferredBy  ReminderOverrideDefault  ReminderPlaySound
       ReminderSet  ReminderSoundFile  ReminderTime  Saved  SelectedMailingAddre
      ss  Sensitivity  Session  Size  Spouse  Subject  Suffix  TTYTDDTelephoneNu
      mber  TaskCompletedDate  TaskDueDate  TaskStartDate  TaskSubject  TelexNum
      ber  Title  ToDoTaskOrdinal  Type  TypeList  UnRead  User1  User2  User3
      User4  UserCertificate  UserProperties  WebPage  YomiCompanyName  YomiFirs
      tName  YomiLastName
User avatar
Morten|Dyalog
 
Posts: 453
Joined: Tue Sep 09, 2008 3:52 pm

Re: Create Outlook contacts from APL

Postby HSeguin on Wed Apr 04, 2018 8:16 pm

Great! Let me try that!

Thanks, Morten!
HSeguin
 
Posts: 8
Joined: Wed Feb 03, 2010 2:43 pm

Re: Create Outlook contacts from APL

Postby Michael|Dyalog on Fri Apr 06, 2018 8:11 am

Years ago I wanted to send mail from APL through Outlook (so I'd have it in my "Sent"-items) and got annoyed with the security-prompts so I looked for alternatives and found "Redemption" as great tool to deal with Outlook in a more reasonable fashion ;-)

Your question reminded me of it (I have since given up Outlook) so I had a look: it is still alive and kicking - and seems to also give access to the Contacts via it ContactItem, so if you're getting annoyed with COM, this might be an alternative...(depending on the context, of course - some biz-environments may not appreciate the lack of security warning, but for me as a sole user it was just a royal pain, so I was glad I could avoid 'em).
Michael|Dyalog
 
Posts: 23
Joined: Thu Mar 02, 2017 4:29 pm


Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest