Section Object
Description
Represents a section (a specific document) in a binder. For example, if a binder contains a Microsoft Excel spreadsheet, two Word documents, and a PowerPoint presentation, the binder contains four sections. The Section object is a member of the Sections collection.
Using the Section Object
Use Sections(index), where index is the number of the section you want to return, to return a single Section object. The index number represents the order in which the sections are listed in the Binder pane. Sections(1) is the first document, and Sections(Sections.Count) is the last document.
Activating a section opens the document in place; it doesn't change the document's index number. All sections are included in the index count, even sections that are hidden. The following example activates the first document in the binder represented by myBinder.
myBinder.Sections(1).Activate
Remarks
The Name property returns or sets the name of the specified section. The following example displays the name of the first section in Binder1.obd.
Set myBinder = GetObject("Binder1.obd", "OfficeBinder.Binder")
theName = myBinder.Sections(1).Name
Set myBinder = Nothing
MsgBox theName
Use the SaveAs method to save a copy of the specified section to a different file. The following example saves section one in Binder1.obd to a new Microsoft Excel workbook.
Set myBinder = GetObject("C:\Binder1.obd", "OfficeBinder.Binder")
If myBinder.Sections(1).Type = "Excel.Sheet.8" Then
myBinder.Sections(1).SaveAs "MyBook3.xls"
End If
The following example activates the section named "Sumsales" in Annual Report.obd.
Set myBinder = GetObject("C:\reports\Annual Report.obd", _
"OfficeBinder.Binder")
myBinder.Visible = True
myBinder.Sections("Sumsales").Activate
Properties
HasBinderHeaderFooter property, Index property, Name property, Object property, Parent property, SupportsBinderHeaderFooter property, Type property, Visible property.
Methods
Activate method, Copy method, Delete method, Move method, PrintOut method, SaveAs method, Update method.