Cannot get Images from AppointmentItem

tsjorda 21 Reputation points
2022-12-16T20:06:20.283+00:00

I have a powershell script that pulls calendar items, saves their body to an RTF file, then concatenates them all into a Word doc. However, it seems that no images embedded in the appointment body are included in the BodyRTF parameter. Is there a way I can get the entire appopintment/meeting body with the images?

References:
AppointmentItem
AppointmentItem.RTFBody

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,628 questions
Office Visual Basic for Applications
Office Visual Basic for Applications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Visual Basic for Applications: An implementation of Visual Basic that is built into Microsoft products.
1,502 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 44,666 Reputation points
    2022-12-20T09:42:11.657+00:00

    Hello there,

    Basically, it's a 2-step process:

    Get reference to the WordEditor object
    Using the clipboard, copy and paste the formatted content into the editor

    The below thread discusses the same issue and you can try out some troubleshooting steps from this and see if that helps you to sort the Issue.
    https://social.msdn.microsoft.com/Forums/office/en-US/f5fd2151-4738-4daa-8116-e9fb1c1b2488/problem-with-images-in-an-meetingitem?forum=outlookdev

    https://social.msdn.microsoft.com/Forums/en-US/b41acf6f-71c1-4a8b-9662-fbff26ba3a24/insert-rich-text-into-an-appointment-item?forum=vsto

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. tsjorda 21 Reputation points
    2022-12-21T21:27:00.457+00:00

    Thank you! I ended up doing the following"

    $objWord = New-Object -ComObject Word.Application  
    $objWord.Visible=1  
    $objDoc = $objWord.Documents.Add()  
    $objSelection = $objWord.Selection  
      
    ...  
      
    $inspector = $appt.GetInspector  
    if ($null -eq $inspector) {  
      Write-Output  "No inspector object found for " $appt.Subject  
      continue  
    }  
    $selection = $inspector.WordEditor.Windows.Item(1).Selection  
    $selection.WholeStory()  
    $selection.Copy()  
      
    ...  
      
    $objSelection.Paste()  
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.