Jump to content
Sign in to follow this  

How to select and mark text in MS Word

Recommended Posts

; Please create a file 'test.doc' on desktop

$wordApp = ObjCreate("word.application")
$wordApp.CommandBars("Standard" ).Visible = True
$wordApp.CommandBars("Formatting" ).Visible = True

$odoc = $wordApp.Documents.Open(@DesktopDir & "\Test.doc")

$wordApp.Visible = True
$wordApp.Top = 79
$wordApp.Height = 375 + 100
$wordApp.WindowState = "wdWindowStateNormal"
$odoc.TrackRevisions = False

$odoc.Range.insertAfter('how to select and mark this text')


I am trying to open word, insert some text and then select it. I am unable to select the text as I would with a mouse or keyboard. Please help me if there is a way to achieve this.

Please create a test.doc file to test script.



Edited by ajit

Share this post

Link to post
Share on other sites


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...