SectionGroup Object

The SectionGroup object encapsulates a group of sections within the sections library.  These sections are stored within the SectionGroup object as a collection of Section objects.  The properties and methods of the SectionGroup object are listed below.

 

Property

Type

Description

Application

Application

Read Only.  Returns a reference to the parent application.

Index

Long

Read Only.  Returns the index of the group within the sections library.

Locked

Boolean

Read Only.  Returns true if the group is locked.

Name

String

Read Only.  Returns the name of group.

Number

Long

Read Only.  Same as Index.

SectionNames

Variant

Read Only.  Returns an array containing the names of all the sections in the group.

Sections

Sections

Read Only.  Returns a reference to the collection of the section in the group.

SectionsLibrary

SectionsLibrary

Read Only.  Returns a reference to the parent sections library object.

 

Creating a new group

A new section group is added to a sections library using the AddGroup method of the SectionGroups collection.  This method accepts three parameters that specify the name of the group, the shape of sections to be stored within the group and a Boolean parameter that specifies if the default property fields for the specified shape are to be automatically constructed by Multiframe.  As property fields cannot be created or modified via the automation interface, this last parameter should always be set equal to true.  The shape of the section to be contained within the group is specified as an enumerated value of type mfSectionShape that has values for all of standard shapes supported within Multiframe.

Dim myGroup as Multiframe.SectionGroup
Dim myGroups as Multiframe.SectionGroups
Dim Name as String

’Get reference to collection of section groups
Set myGroups = mfApp.SectionsLibrary.Groups

' Prompt user to enter name for group.
Name = InputBox(“Enter name of group”,“Multiframe”,“New Group”)

’ If name is valid than add new group to contain I-sections
’ Default property fields for I-sections will be created
If (Len(Name)>0) then
  Set myGroup = myGroups.AddGroup(Name,mfSectionI,true)
End If

The InputBox function is a VBA function that displays a dialog in which the user is prompted to enter a text string.

Properties

The name of the group is interfaced via the Name property of the SectionGroup object.  This property is a string that can be up to 31 characters long.  To be consistent with the other Multiframe objects, the name of the group can also be referenced via the hidden Label property of the SectionGroup object

 

The Locked property of a SectionGroup is a Boolean value that is set equal to true if the group is locked and cannot be modified.  This also excludes the modification of any sections contained within the group.

 

The sections contained within this group are stored within a collection of Section objects that is accessed via the Sections property of the SectionGroup object.  A useful property of the SectionGroup object is the SectionsNames property.  It returns a list of names of all the sections contained within the group.  The names of the sections are listed in the order in which they appear within the Sections collection contained within this group.  This method can be used to rapidly provide data to a user form or dialog containing a list of groups from which the user may choose a section.

 

The SectionsLibrary and Application objects return the parent objects containing this SectionGroup object.