DIAdem Help

Method: AddComment for CommentSelectedElements

  • Updated2024-09-12
  • 1 minute(s) read

Method: AddComment for CommentSelectedElements

Selects the subobject of a comment in DIAdem REPORT associated with a specific index. In order to select an individual frame line, enable the property UseIndividualLineStyle.

Set oCommentSelectedElement = Object.AddComment(ElementType, Index)
ObjectCommentSelectedElements
Object with this method
ElementTypeSpecifies the type of the selected element.
Enumeration with read access and the following selection terms:
 -1
eCommentElementMain 
Main object
 0
eCommentElementArrow 
Arrow
 1
eCommentFrameTop 
Upper frame
 2
eCommentFrameBottom 
Lower frame
 3
eCommentFrameLeft 
Left frame
 4
eCommentFrameRight 
Right frame
IndexLongInteger
Specifies the index of the selected element.
oCommentSelectedElementCommentSelectedElement
Returned object

The following example generates a comment and selects the top frame:

VBScriptPython

 

Dim oMyComment, oMyFrameLine, oMyLineIndividual
Call Report.NewLayout()
Set oMyComment = Report.ActiveSheet.Objects.Add(eReportObjectComment,"MyComment")
Set oMyFrameLine = oMyComment.Comment.BorderLine
Set oMyLineIndividual = oMyFrameLine.LineBottom
oMyFrameLine.UseIndividualLineStyle  = True

Call oMyComment.SelectedElements.AddComment(eCommentFrameTop , 1)