When I try to use UI Automation for PowerPoint 2013, I can only get the first character/word when I use RangeFromPoint

后端 未结 2 949
野的像风
野的像风 2021-01-05 10:52

The code works for Word and Outlook but fails with PowerPoint in that only the first character or first word of the textbox ever gets selected. Is this a bug? Is there any w

2条回答
  •  Happy的楠姐
    2021-01-05 11:12

    I can suggest only Python code getting caption text of the slide (for example). Sorry, I have no time to re-write it on C#. You can play with the PowerPoint.Application COM object and MSDN example of Power Point automation.

    from __future__ import print_function
    import win32com.client as com
    pp = com.Dispatch('PowerPoint.Application')
    print(pp.Presentations[0].Slides[8].Shapes[0].TextFrame.TextRange.Text)
    

提交回复
热议问题