Outlook automation: Outlook must run

I have C/AL code to create a Navision customer as a contact in Outlook. This works fine when Outlook is started. When Outlook is not running, the message “This message is for C/AL programmers: Could not create an instance of the OLE control or Automation server identified by GUID={00062FFF-0000-0000-C000-000000000046} 9.0:{0006F03A-0000-0000-C000-000000000046}:‘Microsoft Outlook 9.0 Object Library’.Application. Check that the OLE control or Automation server is correctly installed and registered.” is displayed. How can I start Outlook, if it’s not already running, to prevent this errormessage?

Hi, I had never faced the problem like this it’s working fine even Outlook is not running. can you send/write the code what you have written for that, then I would be able to give the solution.

CLEAR(OLAppl); CREATE(OLAppl); OLNamespace := OLAppl.GetNamespace(‘MAPI’); OLNamespace.Logon(’’,’’,TRUE,FALSE); OLMapiFolder := OLNamespace.GetDefaultFolder(10); OLContactItem := OLAppl.CreateItem(2) OLContactItem.CompanyName := ‘Name’; OLContactItem.Save; OLNamespace.Logoff;