Type definitions (Excel, VBA)
MSForms
These are the type definitions (an excerpt) of Microsoft Forms 2.0 bundled with RAS. They cover the members of this (the form itself) in a form's code-behind (forms/<name>.ras) and the members of controls such as TextBox, ComboBox and ListBox. Members are written in camelCase (this.txtName.text).
The progress bar and file picker provided by RAS are in Form controls. For how to build a form, see User forms.
Reference
Interface MSForms.StdFont
Font settings (stdole's StdFont).
- #
name: string
The font name.
VBA:
Name- #
size: currency
The font size (points).
VBA:
Size- #
bold: boolean
Bold.
VBA:
Bold- #
italic: boolean
Italic.
VBA:
Italic- #
underline: boolean
Underline.
VBA:
Underline- #
strikethrough: boolean
Strikethrough.
VBA:
Strikethrough- #
weight: short
The weight of the text (400 is normal, 700 is bold).
VBA:
Weight- #
charset: short
The character set.
VBA:
Charset
Interface MSForms.ReturnBoolean
A boolean received as an event argument. Assigning true to value cancels the action (Cancel).
- #
value: boolean
The value.
VBA:
Value
Interface MSForms.ReturnInteger
An integer received as an event argument. For KeyAscii of KeyPress and the like, changing it changes the character or key entered.
- #
value: short
The value.
VBA:
Value
Interface MSForms.ReturnSingle
A real number received as an event argument.
- #
value: float
The value.
VBA:
Value
Interface MSForms.ReturnString
A string received as an event argument.
- #
value: string
The value.
VBA:
Value
Interface MSForms.ReturnEffect
The effect of a drag and drop.
- #
value: fmDropEffect
The value.
VBA:
Value
Interface MSForms.DataObject
Data passed through the clipboard or by drag and drop.
- #
getText(format?: any): string
Gets the data as a string.
VBA:
GetText- #
setText(text: string, format?: any): void
Sets string data.
VBA:
SetText- #
getFormat(format: any): boolean
Whether there is data in the given format.
VBA:
GetFormat- #
getFromClipboard(): void
Reads the content of the clipboard.
VBA:
GetFromClipboard- #
putInClipboard(): void
Writes the content to the clipboard.
VBA:
PutInClipboard- #
startDrag(effect?: any): fmDropEffect
Starts a drag and drop.
VBA:
StartDrag- #
clear(): void
Clears the data.
VBA:
Clear
Interface MSForms.Control
The members common to controls placed on a form or frame (position, size, visibility and so on).
- #
name: string
The name of the control.
VBA:
Name- #
left: float
Position of the left edge in the parent container (points).
VBA:
Left- #
top: float
Position of the top edge in the parent container (points).
VBA:
Top- #
width: float
Width (points).
VBA:
Width- #
height: float
Height (points).
VBA:
Height- #
visible: boolean
Whether it is shown.
VBA:
Visible- #
tag: string
Holds any string.
VBA:
Tag- #
controlTipText: string
The tip shown when the mouse hovers over it.
VBA:
ControlTipText- #
tabIndex: short
The order in which the Tab key moves through controls (0-based).
VBA:
TabIndex- #
tabStop: boolean
Whether it receives the focus with the Tab key.
VBA:
TabStop- #
readonly parent: object
The parent that contains the control (a form, a frame and so on).
VBA:
Parent- #
readonly object: object
The control itself (the object without the extended members).
VBA:
Object- #
helpContextID: int
The help context ID.
VBA:
HelpContextID- #
setFocus(): void
Moves the focus to it.
VBA:
SetFocus- #
move(left?: any, top?: any, width?: any, height?: any, layout?: any): void
Changes its position and size.
VBA:
Move- #
zOrder(zPosition?: any): void
Changes the z-order.
VBA:
ZOrder
Interface MSForms.Controls
A collection of controls (this.controls).
- #
(index: any): Control
Returns a control by name or number (0-based) (default member).
- #
item(index: any): Control
Returns a control by name or number (0-based).
VBA:
Item- #
readonly count: int
The number of controls.
VBA:
Count- #
add(progId: string, name?: any, visible?: any): Control
Adds a control (give a ProgID such as
"Forms.TextBox.1").VBA:
Add- #
remove(index: any): void
Removes a control (only ones added at run time).
VBA:
Remove- #
clear(): void
Removes every control added at run time.
VBA:
Clear
Interface MSForms.UserForm
A user form. In a form's code-behind, this has this type (and the form's controls).
- #
show(modal?: any): void
Shows the form. Passing
vbModeless(0) asmodalshows it modelessly.VBA:
Show- #
hide(): void
Hides the form (without unloading it).
VBA:
Hide- #
caption: string
The text of the title bar.
VBA:
Caption- #
readonly controls: Controls
The controls on the form.
VBA:
Controls- #
readonly activeControl: Control
The control that has the focus.
VBA:
ActiveControl- #
name: string
The name.
VBA:
Name- #
left: float
Position of the left edge (points).
VBA:
Left- #
top: float
Position of the top edge (points).
VBA:
Top- #
width: float
Width (points).
VBA:
Width- #
height: float
Height (points).
VBA:
Height- #
readonly insideWidth: float
Width of the client area (points).
VBA:
InsideWidth- #
readonly insideHeight: float
Height of the client area (points).
VBA:
InsideHeight- #
startUpPosition: int
Where it is shown (0: manual, 1: center of the owner, 2: center of the screen, 3: Windows default).
VBA:
StartUpPosition- #
backColor: int
The background color.
VBA:
BackColor- #
foreColor: int
The text color.
VBA:
ForeColor- #
borderColor: int
The border color.
VBA:
BorderColor- #
enabled: boolean
Whether the controls can be operated.
VBA:
Enabled- #
tag: string
Holds any string.
VBA:
Tag- #
readonly font: StdFont
The font.
VBA:
Font- #
zoom: short
The zoom (percent).
VBA:
Zoom- #
scrollBars: fmScrollBars
Which scroll bars are shown.
VBA:
ScrollBars- #
scrollWidth: float
Width of the scrollable area (points).
VBA:
ScrollWidth- #
scrollHeight: float
Height of the scrollable area (points).
VBA:
ScrollHeight- #
scrollLeft: float
The horizontal scroll position.
VBA:
ScrollLeft- #
scrollTop: float
The vertical scroll position.
VBA:
ScrollTop- #
repaint(): void
Refreshes the display.
VBA:
Repaint- #
move(left?: any, top?: any, width?: any, height?: any, layout?: any): void
Changes its position and size.
VBA:
Move- #
printForm(): void
Prints the form.
VBA:
PrintForm- #
undoAction(): void
Undoes the last action.
VBA:
UndoAction- #
redoAction(): void
Redoes the undone action.
VBA:
RedoAction- #
scroll(actionX?: any, actionY?: any): void
Scrolls to the given position.
VBA:
Scroll
Interface MSForms.Label
interface Label extends Control
A label.
- #
caption: string
The text shown.
VBA:
Caption- #
textAlign: fmTextAlign
The text alignment.
VBA:
TextAlign- #
wordWrap: boolean
Whether the text wraps.
VBA:
WordWrap- #
autoSize: boolean
Whether its size is adjusted to fit the text.
VBA:
AutoSize- #
backColor: int
The background color.
VBA:
BackColor- #
foreColor: int
The text color.
VBA:
ForeColor- #
backStyle: fmBackStyle
Whether the background is transparent (0: transparent, 1: opaque).
VBA:
BackStyle- #
borderStyle: fmBorderStyle
The kind of border.
VBA:
BorderStyle- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
readonly font: StdFont
The font.
VBA:
Font- #
accelerator: string
The access key.
VBA:
Accelerator
Interface MSForms.TextBox
interface TextBox extends Control
A text box.
- #
text: string
The text entered.
VBA:
Text- #
value: any
The value (the same content as
Text).VBA:
Value- #
maxLength: int
The maximum number of characters that can be entered (0 for no limit).
VBA:
MaxLength- #
multiLine: boolean
Whether several lines can be entered.
VBA:
MultiLine- #
passwordChar: string
The character shown in place of the characters entered (password input).
VBA:
PasswordChar- #
locked: boolean
Whether the text is prevented from being changed.
VBA:
Locked- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
selStart: int
The start of the selection (0-based).
VBA:
SelStart- #
selLength: int
The length of the selection.
VBA:
SelLength- #
selText: string
The selected text.
VBA:
SelText- #
readonly textLength: int
The length of the text.
VBA:
TextLength- #
textAlign: fmTextAlign
The text alignment.
VBA:
TextAlign- #
wordWrap: boolean
Whether the text wraps.
VBA:
WordWrap- #
enterKeyBehavior: boolean
Whether the Enter key enters a line break.
VBA:
EnterKeyBehavior- #
tabKeyBehavior: boolean
Whether the Tab key enters a tab character.
VBA:
TabKeyBehavior- #
scrollBars: fmScrollBars
Which scroll bars are shown.
VBA:
ScrollBars- #
imeMode: fmIMEMode
The IME input mode.
VBA:
IMEMode- #
backColor: int
The background color.
VBA:
BackColor- #
foreColor: int
The text color.
VBA:
ForeColor- #
borderStyle: fmBorderStyle
The kind of border.
VBA:
BorderStyle- #
readonly font: StdFont
The font.
VBA:
Font- #
readonly lineCount: int
The number of lines.
VBA:
LineCount- #
curLine: int
The current line (0-based).
VBA:
CurLine- #
copy(): void
Copies the selection to the clipboard.
VBA:
Copy- #
cut(): void
Cuts the selection.
VBA:
Cut- #
paste(): void
Pastes the content of the clipboard.
VBA:
Paste
Interface MSForms.ListControl
interface ListControl extends Control
The members common to controls with a list (ComboBox / ListBox).
- #
addItem(item?: any, index?: any): void
Adds an item. When
indexis omitted, it is added at the end.VBA:
AddItem- #
removeItem(index: any): void
Removes an item (numbers are 0-based).
VBA:
RemoveItem- #
clear(): void
Removes every item.
VBA:
Clear- #
list(index?: any, column?: any): any
Returns the value of an item. Without arguments, returns all items as a 2-D array.
A property with arguments (it can be assigned to:
x(…) = value).VBA:
List- #
column(column?: any, index?: any): any
Returns the value of a column.
A property with arguments (it can be assigned to:
x(…) = value).VBA:
Column- #
readonly listCount: int
The number of items.
VBA:
ListCount- #
listIndex: int
The number of the selected item (0-based; -1 when none is selected).
VBA:
ListIndex- #
topIndex: int
The number of the item shown at the top.
VBA:
TopIndex- #
value: any
The value.
VBA:
Value- #
text: string
The text of the selected item.
VBA:
Text- #
columnCount: int
The number of columns.
VBA:
ColumnCount- #
columnWidths: string
The widths of the columns (in the form
"50 pt;80 pt").VBA:
ColumnWidths- #
columnHeads: boolean
Whether column headings are shown.
VBA:
ColumnHeads- #
boundColumn: any
The column used for
Value(1-based).VBA:
BoundColumn- #
textColumn: any
The column used for
Text(0-based).VBA:
TextColumn- #
rowSource: string
The cell range the items come from (
"Sheet1!A1:A10").VBA:
RowSource- #
controlSource: string
The cell linked to the value (
"Sheet1!B1").VBA:
ControlSource- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
locked: boolean
Whether the value is prevented from being changed.
VBA:
Locked- #
backColor: int
The background color.
VBA:
BackColor- #
foreColor: int
The text color.
VBA:
ForeColor- #
readonly font: StdFont
The font.
VBA:
Font- #
textAlign: fmTextAlign
The text alignment.
VBA:
TextAlign
Interface MSForms.ComboBox
interface ComboBox extends ListControl
A combo box.
- #
style: fmStyle
Whether only items from the list can be chosen (
fmStyleDropDownList) or typing is also allowed.VBA:
Style- #
matchRequired: boolean
Whether a typed value not in the list is rejected.
VBA:
MatchRequired- #
matchEntry: fmMatchEntry
How the list completes the input as you type.
VBA:
MatchEntry- #
listRows: int
The number of rows shown in the list at once.
VBA:
ListRows- #
listWidth: any
The width of the list.
VBA:
ListWidth- #
maxLength: int
The maximum number of characters that can be entered.
VBA:
MaxLength- #
selStart: int
The start of the selection.
VBA:
SelStart- #
selLength: int
The length of the selection.
VBA:
SelLength- #
selText: string
The selected text.
VBA:
SelText- #
readonly textLength: int
The length of the text.
VBA:
TextLength- #
dropDown(): void
Shows the list.
VBA:
DropDown- #
copy(): void
Copies the selection to the clipboard.
VBA:
Copy- #
cut(): void
Cuts the selection.
VBA:
Cut- #
paste(): void
Pastes the content of the clipboard.
VBA:
Paste
Interface MSForms.ListBox
interface ListBox extends ListControl
A list box.
- #
multiSelect: fmMultiSelect
Whether several items can be selected.
VBA:
MultiSelect- #
selected(index: any): boolean
Whether the item is selected (numbers are 0-based).
A property with arguments (it can be assigned to:
x(…) = value).VBA:
Selected- #
listStyle: fmListStyle
How items are shown (with check boxes and so on).
VBA:
ListStyle- #
integralHeight: boolean
Whether the height is a whole multiple of the item height.
VBA:
IntegralHeight- #
matchEntry: fmMatchEntry
How items are selected as you type.
VBA:
MatchEntry
Interface MSForms.CommandButton
interface CommandButton extends Control
A command button.
- #
caption: string
The text shown.
VBA:
Caption- #
default: boolean
Whether it is the button pressed by the Enter key.
VBA:
Default- #
cancel: boolean
Whether it is the button pressed by the Esc key.
VBA:
Cancel- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
takeFocusOnClick: boolean
Whether it takes the focus when clicked.
VBA:
TakeFocusOnClick- #
accelerator: string
The access key.
VBA:
Accelerator- #
backColor: int
The background color.
VBA:
BackColor- #
foreColor: int
The text color.
VBA:
ForeColor- #
wordWrap: boolean
Whether the text wraps.
VBA:
WordWrap- #
autoSize: boolean
Whether its size is adjusted to fit the text.
VBA:
AutoSize- #
readonly font: StdFont
The font.
VBA:
Font
Interface MSForms.ToggleControl
interface ToggleControl extends Control
The members common to on / off controls (CheckBox / OptionButton / ToggleButton).
- #
value: any
The value (
true/false;nullfor the third state).VBA:
Value- #
caption: string
The text shown.
VBA:
Caption- #
tripleState: boolean
Whether it has three states.
VBA:
TripleState- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
locked: boolean
Whether the value is prevented from being changed.
VBA:
Locked- #
accelerator: string
The access key.
VBA:
Accelerator- #
backColor: int
The background color.
VBA:
BackColor- #
foreColor: int
The text color.
VBA:
ForeColor- #
controlSource: string
The cell linked to the value (
"Sheet1!B1").VBA:
ControlSource- #
wordWrap: boolean
Whether the text wraps.
VBA:
WordWrap- #
readonly font: StdFont
The font.
VBA:
Font
Interface MSForms.CheckBox
interface CheckBox extends ToggleControl
A check box.
Interface MSForms.OptionButton
interface OptionButton extends ToggleControl
An option button.
- #
groupName: string
The name of the group of buttons of which only one can be selected at a time.
VBA:
GroupName
Interface MSForms.ToggleButton
interface ToggleButton extends ToggleControl
A toggle button.
Interface MSForms.SpinButton
interface SpinButton extends Control
A spin button.
- #
value: int
The value.
VBA:
Value- #
min: int
The minimum value.
VBA:
Min- #
max: int
The maximum value.
VBA:
Max- #
smallChange: int
The amount changed by one click.
VBA:
SmallChange- #
orientation: fmOrientation
The orientation.
VBA:
Orientation- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
controlSource: string
The cell linked to the value (
"Sheet1!B1").VBA:
ControlSource
Interface MSForms.ScrollBar
interface ScrollBar extends Control
A scroll bar.
- #
value: int
The value.
VBA:
Value- #
min: int
The minimum value.
VBA:
Min- #
max: int
The maximum value.
VBA:
Max- #
smallChange: int
The amount changed by clicking an arrow.
VBA:
SmallChange- #
largeChange: int
The amount changed by clicking outside the thumb.
VBA:
LargeChange- #
orientation: fmOrientation
The orientation.
VBA:
Orientation- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
controlSource: string
The cell linked to the value (
"Sheet1!B1").VBA:
ControlSource
Interface MSForms.Image
interface Image extends Control
An image.
- #
picture: object
The picture shown (loaded with
loadPicture).VBA:
Picture- #
pictureSizeMode: fmPictureSizeMode
How the picture is sized.
VBA:
PictureSizeMode- #
pictureAlignment: fmPictureAlignment
The alignment of the picture.
VBA:
PictureAlignment- #
pictureTiling: boolean
Whether the picture is tiled.
VBA:
PictureTiling- #
autoSize: boolean
Whether its size is adjusted to fit the picture.
VBA:
AutoSize- #
backColor: int
The background color.
VBA:
BackColor- #
borderStyle: fmBorderStyle
The kind of border.
VBA:
BorderStyle- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled
Interface MSForms.Frame
interface Frame extends Control
A frame.
- #
caption: string
The text of the heading.
VBA:
Caption- #
readonly controls: Controls
The controls in the frame.
VBA:
Controls- #
readonly activeControl: Control
The control that has the focus.
VBA:
ActiveControl- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
backColor: int
The background color.
VBA:
BackColor- #
foreColor: int
The text color.
VBA:
ForeColor- #
scrollBars: fmScrollBars
Which scroll bars are shown.
VBA:
ScrollBars- #
readonly font: StdFont
The font.
VBA:
Font- #
repaint(): void
Refreshes the display.
VBA:
Repaint
Interface MSForms.Page
A page of a multi-page.
- #
caption: string
The text shown on the tab.
VBA:
Caption- #
name: string
The name.
VBA:
Name- #
readonly controls: Controls
The controls on the page.
VBA:
Controls- #
index: int
The number (0-based).
VBA:
Index- #
visible: boolean
Whether it is shown.
VBA:
Visible- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
tag: string
Holds any string.
VBA:
Tag- #
controlTipText: string
The tip shown when the mouse hovers over it.
VBA:
ControlTipText
Interface MSForms.Pages
The pages of a multi-page.
- #
(index: any): Page
Returns a page by name or number (0-based) (default member).
- #
item(index: any): Page
Returns a page by name or number (0-based).
VBA:
Item- #
readonly count: int
The number of pages.
VBA:
Count- #
add(name?: any, caption?: any, index?: any): Page
Adds a page.
VBA:
Add- #
remove(index: any): void
Removes a page.
VBA:
Remove- #
clear(): void
Removes every page.
VBA:
Clear
Interface MSForms.MultiPage
interface MultiPage extends Control
A multi-page.
- #
readonly pages: Pages
The pages.
VBA:
Pages- #
value: int
The number of the selected page (0-based).
VBA:
Value- #
readonly selectedItem: Page
The selected page.
VBA:
SelectedItem- #
tabOrientation: fmTabOrientation
The position of the tabs.
VBA:
TabOrientation- #
style: fmTabStyle
How the tabs are shown.
VBA:
Style- #
multiRow: boolean
Whether tabs are arranged in several rows.
VBA:
MultiRow- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
readonly font: StdFont
The font.
VBA:
Font
Interface MSForms.Tab
A tab of a tab strip.
- #
caption: string
The text shown.
VBA:
Caption- #
name: string
The name.
VBA:
Name- #
index: int
The number (0-based).
VBA:
Index- #
visible: boolean
Whether it is shown.
VBA:
Visible- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
tag: string
Holds any string.
VBA:
Tag- #
controlTipText: string
The tip shown when the mouse hovers over it.
VBA:
ControlTipText
Interface MSForms.Tabs
The tabs of a tab strip.
- #
(index: any): Tab
Returns a tab by name or number (0-based) (default member).
- #
item(index: any): Tab
Returns a tab by name or number (0-based).
VBA:
Item- #
readonly count: int
The number of tabs.
VBA:
Count- #
add(name?: any, caption?: any, index?: any): Tab
Adds a tab.
VBA:
Add- #
remove(index: any): void
Removes a tab.
VBA:
Remove- #
clear(): void
Removes every tab.
VBA:
Clear
Interface MSForms.TabStrip
interface TabStrip extends Control
A tab strip.
- #
readonly tabs: Tabs
The tabs.
VBA:
Tabs- #
value: int
The number of the selected tab (0-based).
VBA:
Value- #
readonly selectedItem: Tab
The selected tab.
VBA:
SelectedItem- #
tabOrientation: fmTabOrientation
The position of the tabs.
VBA:
TabOrientation- #
style: fmTabStyle
How the tabs are shown.
VBA:
Style- #
multiRow: boolean
Whether tabs are arranged in several rows.
VBA:
MultiRow- #
enabled: boolean
Whether it can be operated.
VBA:
Enabled- #
readonly font: StdFont
The font.
VBA:
Font
Enum MSForms.fmSpecialEffect
The kind of 3-D appearance of a control.
Enum MSForms.fmTextAlign
The text alignment.
Enum MSForms.fmBackStyle
How the background is shown.
Enum MSForms.fmBorderStyle
The kind of border.
Enum MSForms.fmScrollBars
Which scroll bars are shown.
Enum MSForms.fmStyle
The kind of ComboBox.
Enum MSForms.fmMatchEntry
How items are selected as you type.
Enum MSForms.fmMultiSelect
Multiple selection of a ListBox.
Enum MSForms.fmListStyle
How the items of a ListBox are shown.
Enum MSForms.fmOrientation
The orientation.
Enum MSForms.fmPictureSizeMode
How a picture is sized.
Enum MSForms.fmPictureAlignment
The alignment of a picture.
Enum MSForms.fmTabOrientation
The position of the tabs.
Enum MSForms.fmTabStyle
How the tabs are shown.
Enum MSForms.fmIMEMode
The IME input mode.
Enum MSForms.fmDropEffect
The effect of a drag and drop.
Enum MSForms.fmDragState
The state of a drag.
Enum MSForms.fmAction
The action of a drop or paste.
Enum MSForms.fmScrollAction
The scroll action.
Function load
function load(object: any): void
VBA: Load
Loads a user form (without showing it).
Function unload
function unload(object: any): void
VBA: Unload
Closes a user form and removes it from memory. unload(this) closes the form itself.
Function loadPicture
function loadPicture(fileName?: any): object
VBA: LoadPicture
Loads an image file. Assign it to picture of an Image and so on.
Global vbModal
const vbModal: int
Argument of show: shows the form modally.
Global vbModeless
const vbModeless: int
Argument of show: shows the form modelessly.
Global vbFormControlMenu
const vbFormControlMenu: int
CloseMode of QueryClose: closed with the close button on the title bar.
Global vbFormCode
const vbFormCode: int
CloseMode of QueryClose: closed by unload in code.
Global vbAppWindows
const vbAppWindows: int
CloseMode of QueryClose: closed because Windows is shutting down.
Global vbAppTaskManager
const vbAppTaskManager: int
CloseMode of QueryClose: closed by the Task Manager.