RAS Playground 日本語 GitHub

Type definitions (Excel, VBA)

Office

These are the type definitions (an excerpt) of the common Office library bundled with RAS. They include the file / folder selection dialog (FileDialog, from application.fileDialog(…)) and IRibbonUI / IRibbonControl, which ribbon callbacks receive. Members are written in camelCase.

Reference

Interface Office.FileDialog

A standard dialog for selecting files or folders. Get it with Application.FileDialog.

Microsoft reference

#
show(): int

Shows the dialog. Returns -1 when the action button is clicked and 0 when canceled.

Microsoft reference

VBA: Show

#
execute(): void

In an Open / Save As dialog, performs the action on the selected files.

Microsoft reference

VBA: Execute

#
readonly selectedItems: FileDialogSelectedItems

The collection of paths the user selected.

Microsoft reference

VBA: SelectedItems

#
readonly filters: FileDialogFilters

The collection of file type filters.

Microsoft reference

VBA: Filters

#
filterIndex: int

The number of the filter selected at first (1-based).

Microsoft reference

VBA: FilterIndex

#
title: string

The title of the dialog.

Microsoft reference

VBA: Title

#
buttonName: string

The text shown on the action button.

Microsoft reference

VBA: ButtonName

#
allowMultiSelect: boolean

Whether several files can be selected.

Microsoft reference

VBA: AllowMultiSelect

#
initialFileName: string

The folder or file name shown at first.

Microsoft reference

VBA: InitialFileName

#
initialView: MsoFileDialogView

The initial view of the file list.

Microsoft reference

VBA: InitialView

#
readonly dialogType: MsoFileDialogType

The kind of dialog.

Microsoft reference

VBA: DialogType

#
readonly item: string

VBA: Item

#
readonly application: object

VBA: Application

#
readonly parent: object

VBA: Parent

office.d.ras

Interface Office.FileDialogSelectedItems

The collection of paths selected in a FileDialog.

Microsoft reference

#
(index: int): string

Returns a selected path by index (1-based) (default member).

Microsoft reference

#
item(index: int): string

Returns a selected path by index (1-based).

Microsoft reference

VBA: Item

#
readonly count: int

The number of selected paths.

Microsoft reference

VBA: Count

#
readonly application: object

VBA: Application

#
readonly parent: object

VBA: Parent

office.d.ras

Interface Office.FileDialogFilters

The collection of file type filters of a FileDialog.

Microsoft reference

#
(index: int): FileDialogFilter

Returns a filter by index (1-based) (default member).

Microsoft reference

#
item(index: int): FileDialogFilter

Returns a filter by index (1-based).

Microsoft reference

VBA: Item

#
readonly count: int

The number of filters.

Microsoft reference

VBA: Count

#
add(description: string, extensions: string, position?: any): FileDialogFilter

Adds a filter. Give the extensions in the form "*.xlsx; *.xlsm".

Microsoft reference

VBA: Add

#
clear(): void

Deletes every filter.

Microsoft reference

VBA: Clear

#
delete(filter?: any): void

Deletes one filter.

Microsoft reference

VBA: Delete

#
readonly application: object

VBA: Application

#
readonly parent: object

VBA: Parent

office.d.ras

Interface Office.FileDialogFilter

One file type filter of a FileDialog.

Microsoft reference

#
readonly description: string

The description of the filter.

Microsoft reference

VBA: Description

#
readonly extensions: string

The extensions it covers (in the form "*.xlsx; *.xlsm").

Microsoft reference

VBA: Extensions

#
readonly application: object

VBA: Application

#
readonly parent: object

VBA: Parent

office.d.ras

Interface Office.IRibbonUI

The ribbon UI. Received in the onLoad callback of the ribbon XML and used to refresh the display.

Microsoft reference

#
invalidate(): void

Makes every callback of the custom ribbon be evaluated again.

Microsoft reference

VBA: Invalidate

#
invalidateControl(controlId: string): void

Makes only the control with the given ID be evaluated again.

Microsoft reference

VBA: InvalidateControl

#
invalidateControlMso(controlId: string): void

Makes the built-in control with the given ID be evaluated again.

Microsoft reference

VBA: InvalidateControlMso

#
activateTab(controlId: string): void

Activates the custom tab with the given ID.

Microsoft reference

VBA: ActivateTab

#
activateTabMso(controlId: string): void

Activates the built-in tab with the given ID.

Microsoft reference

VBA: ActivateTabMso

#
activateTabQ(controlId: string, namespace: string): void

Activates the custom tab given by a namespace-qualified ID.

Microsoft reference

VBA: ActivateTabQ

office.d.ras

Interface Office.IRibbonControl

The control that was operated, passed to ribbon callbacks.

Microsoft reference

#
readonly id: string

The ID of the control given in the ribbon XML.

Microsoft reference

VBA: Id

#
readonly tag: string

The value of the tag attribute given in the ribbon XML.

Microsoft reference

VBA: Tag

#
readonly context: object

An object representing the window that has the control.

Microsoft reference

VBA: Context

office.d.ras

Enum Office.MsoFileDialogType

Specifies the kind of FileDialog.

Microsoft reference

#
msoFileDialogFilePicker = 3
#
msoFileDialogFolderPicker = 4
#
msoFileDialogOpen = 1
#
msoFileDialogSaveAs = 2

office.d.ras

Enum Office.MsoFileDialogView

Specifies the view of a FileDialog's file list.

Microsoft reference

#
msoFileDialogViewDetails = 2
#
msoFileDialogViewLargeIcons = 6
#
msoFileDialogViewList = 1
#
msoFileDialogViewPreview = 4
#
msoFileDialogViewProperties = 3
#
msoFileDialogViewSmallIcons = 7
#
msoFileDialogViewThumbnail = 5
#
msoFileDialogViewTiles = 9
#
msoFileDialogViewWebView = 8

office.d.ras

Enum Office.MsoTriState

A three-state value that can express "mixed" and so on besides true / false.

Microsoft reference

#
msoCTrue = 1
#
msoFalse = 0
#
msoTriStateMixed = -2
#
msoTriStateToggle = -3
#
msoTrue = -1

office.d.ras

Enum Office.MsoAutomationSecurity

Specifies the macro security used when opening files from a program.

Microsoft reference

#
msoAutomationSecurityByUI = 2
#
msoAutomationSecurityForceDisable = 3
#
msoAutomationSecurityLow = 1

office.d.ras

Enum Office.MsoFillType

The kind of fill of a shape.

Microsoft reference

#
msoFillBackground = 5
#
msoFillGradient = 3
#
msoFillMixed = -2
#
msoFillPatterned = 2
#
msoFillPicture = 6
#
msoFillSolid = 1
#
msoFillTextured = 4

office.d.ras

Enum Office.MsoShapeType

The kind of shape.

Microsoft reference

#
mso3DModel = 30
#
msoAutoShape = 1
#
msoCallout = 2
#
msoCanvas = 20
#
msoChart = 3
#
msoComment = 4
#
msoContentApp = 27
#
msoDiagram = 21
#
msoEmbeddedOLEObject = 7
#
msoFormControl = 8
#
msoFreeform = 5
#
msoGraphic = 28
#
msoGroup = 6
#
msoIgxGraphic = 24
#
msoInk = 22
#
msoInkComment = 23
#
msoLine = 9
#
msoLinked3DModel = 31
#
msoLinkedGraphic = 29
#
msoLinkedOLEObject = 10
#
msoLinkedPicture = 11
#
msoMedia = 16
#
msoOLEControlObject = 12
#
msoPicture = 13
#
msoPlaceholder = 14
#
msoScriptAnchor = 18
#
msoShapeTypeMixed = -2
#
msoSlicer = 25
#
msoTable = 19
#
msoTextBox = 17
#
msoTextEffect = 15
#
msoWebVideo = 26

office.d.ras

Enum Office.MsoAutoShapeType

Specifies the shape of an AutoShape (common ones only).

Microsoft reference

#
msoShapeRectangle = 1
#
msoShapeRoundedRectangle = 5
#
msoShapeOval = 9
#
msoShapeDiamond = 4
#
msoShapeIsoscelesTriangle = 7
#
msoShapeRightTriangle = 8
#
msoShapeParallelogram = 2
#
msoShapeTrapezoid = 3
#
msoShapeHexagon = 10
#
msoShapeOctagon = 6
#
msoShapeCross = 11
#
msoShapeRegularPentagon = 12
#
msoShapeRightArrow = 33
#
msoShapeLeftArrow = 34
#
msoShapeUpArrow = 35
#
msoShapeDownArrow = 36
#
msoShapeLeftRightArrow = 37
#
msoShapeUpDownArrow = 38
#
msoShape5pointStar = 92
#
msoShapeHeart = 21
#
msoShapeCloud = 179
#
msoShapeDonut = 18
#
msoShapeCube = 14
#
msoShapeCan = 13
#
msoShapeRectangularCallout = 105
#
msoShapeRoundedRectangularCallout = 106
#
msoShapeOvalCallout = 107
#
msoShapeCloudCallout = 108
#
msoShapeFlowchartProcess = 61
#
msoShapeFlowchartDecision = 63
#
msoShapeFlowchartTerminator = 69
#
msoShapeFlowchartData = 64
#
msoShapeFlowchartConnector = 73
#
msoShapeMixed = -2

office.d.ras

Enum Office.MsoTextOrientation

Specifies the orientation of text in a shape.

Microsoft reference

#
msoTextOrientationDownward = 3
#
msoTextOrientationHorizontal = 1
#
msoTextOrientationHorizontalRotatedFarEast = 6
#
msoTextOrientationMixed = -2
#
msoTextOrientationUpward = 2
#
msoTextOrientationVertical = 5
#
msoTextOrientationVerticalFarEast = 4

office.d.ras

Enum Office.MsoZOrderCmd

Specifies how to move a shape in the z-order.

Microsoft reference

#
msoBringForward = 2
#
msoBringInFrontOfText = 4
#
msoBringToFront = 0
#
msoSendBackward = 3
#
msoSendBehindText = 5
#
msoSendToBack = 1

office.d.ras