PowerPoint possible bug VBA - Microsoft Community


eventsub windowselectionchange(byval sel selection)

error accessing notespage
selecting notespage sel/activewindow.selection has no shaperange. bug? textrange needs hosting shape.

work round:

if textrange has no parent (shape) guess sel selecting notespage

private sub app_windowselectionchange(byval sel selection)

if sel.type = ppselectiontext then
if sel.textrange.parent nothing , sel.sliderange.hasnotespage then
    application.caption = "word.count( notespage )= " & sel.sliderange.notespage.shapes.placeholders(ppplaceholderbody).textframe.textrange.words.count
  else
    application.caption = "word.count( " & sel.shaperange(1).name & " )= " & sel.shaperange(1).textframe.textrange.words.count
  end if
end if

end sub


 

the parent of textrange isn't slide, it's textframe.

to parent shape, use textrange.parent.parent

to parent slide, textrange.parent.parent.parent

unless selected text part of table; in case, set hair on fire , run screaming weeds.  tables buggy.



Office / PowerPoint / Windows 10 / Office 2016



Comments

Popular posts from this blog

message deleted by transport agent, event: LED=550 4.3.2 - Microsoft Community

Outlook conversion problem - Microsoft Community

Outlook 2016 - Insert attachment to Meeting Invite You Do Not Own - Microsoft Community