How can I get an element at VSTA Runtime?

How can I get an element at VSTA Runtime?

In VSTA Workspace, I can get static text property. like this: [System.AddIn.AddIn("MyWorkspace", Version = "1.0", Publisher = "", Description = "")] ... zenOn.IDynPicture scr = this.ActiveDocument.DynPictures().Item("Dashboard"); zenOn.IElement Text = scr.Elements().Item("Static text_1_2"); string textProp = (Text.get_DynProperties("Text")).ToString(); ... The below code throw exception: textProp is null [System.AddIn.AddIn("ThisProject", Version = "1.0", Publisher = "", Description = "")] ... zenOn.IDynPicture screen = this.DynPictures().Item("Dashboard"); zenOn.IElement text = screen.Elements().Item("Static text_1_2"); string textProp = (text.get_DynProperties("Text")).ToString(); Thanks.

This is a migrated post! Originally posted on 17.03.2017 by user monad. Please be aware that information can be outdated.