Page 1 of 1

Trouble creating meeting request

Posted: Fri Aug 10, 2018 3:54 am
by ralf_jantschek
Hello,
I'm experiencing problems when I try to create a meeting request under a certain Outlook Version.
The following code works fine under
Outlook Version: 16.0.0.4705
  1.    
  2.         $ol = new-object -comObject Outlook.Application
  3.         $olNamespace = $ol.GetNamespace("MAPI")
  4.         $calendar = $olNamespace.Folders("Path to the folder where the appointment is created in")
  5.         $termin = $calendar.Items.Add("IPM.Appointment")
under Outlook Version: 15.0.0.5041
the last command returns: ERROR: You cannot call a method on a null-valued expression.
And
  1. $calender
is empty!


Product, version and build:
64 bit version of product:
Sapien PowerShell Studio 2018 5.5.153.0
Operating system:
64 bit OS:
Windows 10 Enterprise 1703 Build 15063.1209

*** Please add details and screenshots as needed below. ***

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

Re: Trouble creating meeting request

Posted: Fri Aug 10, 2018 7:10 am
by davidc
[TOPIC MOVED TO WINDOWS POWERSHELL FORUM BY MODERATOR]

Re: Trouble creating meeting request

Posted: Fri Aug 10, 2018 7:45 am
by jvierra
The only correct way to create an appointment item is this:

$appointment = $ol.CreateItem('olAppointmentItem')

Re: Trouble creating meeting request

Posted: Mon Aug 13, 2018 12:01 am
by ralf_jantschek
Hello,
as I have to create the appointment in different mailbox hence the
  1.  $calendar = $olNamespace.Folders("Path to the folder where the appointment is created in")
your suggestion won't work

Re: Trouble creating meeting request

Posted: Mon Aug 13, 2018 12:08 am
by jvierra
Pick the mailbox and save the appointment I n that mailbox.

$mailbox = $olNamespace.Stores('userid@domain.com')
$appointment = $ol.CreateItem('olAppointmentItem')
$mailbox.Folders['foldername'].Items.Add($appointment)