Search notes:

Office Object Model: Word - Selection

The Selection object refers to the currently selected portion of a document.
Compare the Selection object with the range object.

Methods and properties

active
application
boldRun()
bookmarkID
bookmarks
borders
calculate()
cells
characters
childShapeRange
clearCharacterAllFormatting()
clearCharacterDirectFormatting()
clearCharacterStyle()
clearFormatting()
clearParagraphAllFormatting()
clearParagraphDirectFormatting()
clearParagraphStyle()
collapse() Moves either the starting (wdCollapseEnd) or ending (wdCollapseStart) position to the other position so that both become the equal position. Compare with range.collapse()]
columns
columnSelectMode
comments
convertToTable()
copy()
copyAsPicture()
copyFormat()
createAutoTextEntry()
createTextbox()
creator
cut()
delete()
detectLanguage()
document
editors
end
endKey()
endnoteOptions
endnotes
endOf()
enhMetaFileBits
escapeKey()
expand()
exportAsFixedFormat()
exportAsFixedFormat2()
extend()
extendMode
fields
find
fitTextWidth
flags
font
footnoteOptions
footnotes
formattedText
formFields
frames
goTo()
goToEditableRange()
goToNext()
goToPrevious()
hasChildShapeRange
headerFooter
homeKey()
hTMLDivisions
hyperlinks
information
inlineShapes
inRange()
insertAfter()
insertBefore()
insertBreak()
insertCaption()
insertCells()
insertColumns()
insertColumnsRight()
insertCrossReference()
insertDateTime()
insertFile()
insertFormula()
insertNewPage()
insertParagraph()
insertParagraphAfter()
insertParagraphBefore()
insertRows()
insertRowsAbove()
insertRowsBelow()
insertStyleSeparator()
insertSymbol()
insertXML()
inStory()
iPAtEndOfLine
isEndOfRowMark
isEqual()
italicRun()
languageDetected
languageID
languageIDFarEast
languageIDOther
ltrPara()
ltrRun()
move()
moveDown()
moveEnd()
moveEndUntil()
moveEndWhile()
moveLeft()
moveRight()
moveStart()
moveStartUntil()
moveStartWhile()
moveUntil()
moveUp()
moveWhile()
next()
nextField()
nextRevision()
nextSubdocument()
noProofing
oMaths
orientation
pageSetup
paragraphFormat
paragraphs
parent
paste()
pasteAndFormat()
pasteAppendTable()
pasteAsNestedTable()
pasteExcelTable()
pasteFormat()
pasteSpecial()
previous()
previousBookmarkID
previousField()
previousRevision()
previousSubdocument()
range A range object.
readingModeGrowFont()
readingModeShrinkFont()
rows
rtlPara()
rtlRun()
sections
select()
selectCell()
selectColumn()
selectCurrentAlignment()
selectCurrentColor()
selectCurrentFont()
selectCurrentIndent()
selectCurrentSpacing()
selectCurrentTabs()
selectRow()
sentences
setRange()
shading
shapeRange
shrink()
shrinkDiscontiguousSelection()
sort()
sortAscending()
sortByHeadings()
sortDescending()
splitTable()
start
startIsActive
startOf()
storyLength
storyType
style
tables
text
toggleCharacterCode()
topLevelTables
type
typeBackspace()
typeParagraph()
typeText() Inserts text
wholeStory()
wordOpenXML
words
XML

typeText

' ..\..\..\runVBAFilesInOffice.vbs -word %CD%\typeText -c main

sub main()

  selection.typeText "Hello World"

  selection.typeParagraph

  selection.typeText "The number is, of course, forty-two"

  selection.typeText chr(13)

  selection.typeText "Another line"

  activeDocument.saved = true

end sub
Github repository about-MS-Office-object-model, path: /Word/Selection/typeText.bas

See also

The window.selection property.
Word Object Model

Index