How to move an appointment item from one to another shared calendar in Outlook custom form’s Script

You can use the following code to move the current appointment item from one calendar to shared calendar, let’s say you are working on Appointment custom form and want to move the current item to another exchange server’s shared calendar. You can use Item.Move function on the Item_write() procedure in the custom form’s vb script.

Function Item_Write()
   Dim oOutlook
   Dim oNS
   Dim oRec
   Dim oFolder
 
   Set oOutlook = Item.Application
   Set oNS = oOutlook.GetNameSpace("MAPI")
   Set oRec = oNS.CreateRecipient("Write recipient name")
   oRec.Resolve
   If oRec.Resolved Then
      Set oFolder = oNS.GetSharedDefaultFolder(oRec, 9)
      If Item.Saved = False Then
         Item.Save()
      End If
   Item.Move oFolder
   Item_Write = False
   Item.Close olDiscard
End if