Automate document processing by a keyboard macro

MouseRobot keyboard recorder is universal, easy to use keyboard macro recorder and uses the principles of visual programming. At the same time it can automatically execute as keyboard macro all problems that need to be done by hand – data input, key pressing, and all this working with different programs. Distinction of MouseRobot keyboard recorder is its reliability – program constantly analyzes all results of proceeded steps and stops procedure if anything goes wrong in keyboard macro.

Commonly speaking, MouseRobot adds macros support, or, in other words – automated keyboard recording and keyboard macro execution, to any existing program.

Record keyboard and automate document peocessing

Let’s, for example, show you how MouseRobot can record keyboard and automate document processing based on previously created template. The typical actions for this work do not depend on the document type:

  1. Open blank document
  2. Input data in the document, for example clients name and date
  3. Save document under new name
  4. Print document we got

To show how to make keyboard macro, let’s create a simple template of contract between the company and some client, where the client’s name should be lets put "[customer name]", and on the data place let’s put "[date]".

Document template

Start MouseRobot keyboard recorder and add "Start Word" step

  • Drag "Windows command" step from "Toolbox" into keyboard macro
  • Choose document template file in the "Command, object or file" field

Windows command step

Now, when you push "Run" button a new Microsoft Word window will open and it should have an agreement template in it.

Add steps to change "[customer name]" and "[date]" to real name and date in the keyboard macro

Let’s set up MouseRobot keyboard recorder into steps recording – just turn on "Record task" mode. In this mode program recognizes an object type that is under the mouse – a button, field, window or any other and marks it with red outline and record keyboard actions on it - a mouse click, key press, etc.

    Object selecting mode

  • To choose the "Replace" button in Microsoft Word point the mouse on it and push CTRL to show MouseRobot keyboard recorder that desired object is chosen. MouseRobot will need 1-2 seconds to recognize and record all important differences between "Replace" and other buttons.
  • When recording is finished MouseRobot keyboard recorder will turn into record actions mode and show green information module.
  • Recording actions

  • To record keyboard in the action recording mode just click the left mouse button on it. MouseRobot keyboard recorder will go on recording actions until mouse moves or keys pressed. To finish recording keyboard macro just stop moving mouse and pressing keys for 5 seconds. After it MouseRobot will turn into "Object choice" mode.

Lets record "Find and Replace" dialog window actions.

  • First highlight and record (press CTRL) dialogue window header. MouseRobot keyboard recorder will record that after pushing "Replace" button a dialog window "Find and Replace" should appear.
  • That’s the way MouseRobot keyboard recorder works – program records keyboard and mouse actions logical order (button pressed) and results (dialogue window appears), and checks it when keyboard macro is being proceed.

  • After the green prompting of action record mode has appeared, record keyboard and type "[customer name]" in "Find what" field. After that go to "Replace with" field by clicking TAB and enter there the customer name, for example, "John Smith".
  • Find and replace dialog

  • Wait for return to the object selection mode and record the click on "Replace All" button as well as click on "OK" button in the dialogue with the information about carried out replacements which opens after all these actions.
  • Finish recording keyboard macro by pressing ESC

MouseRobot will work up all recorded data automatically and will turn them in steps of keyboard macro, particular "button click" and "type-setting of text".

Steps of putting the date of agreement do not differ much from the steps of putting name which have been just written. That is why instead of spending time to write them again we may just copy the existed steps. After that it is just necessary to replace line "[customer name]" to "[date]" and "John Smith" to, for example, "12 July 2010" in step "Send input".

Mouse and keyboard step

Saving created document in keyboard macro

Now we’ll automate the saving of document under the unique name, for example, "Agreement with John Smith.docx".

We’ll use "Record task" function again and write the steps of saving the document through "File" – "Save as".

Saving document

We’ll write into keyboard macro the steps of sending document to print in the same way.

Printing document

Customer name and date input

Now we’ll teach MouseRobot keyboard recorder to substitute any customer name and date noticed by us, but not just "John Smith" and "12 July 2010". To do so we have to drag "Dialog with condition" fragment to the beginning of keyboard macro.

Dialog with condition snippet

IMPORTANT NOTE: MouseRobot fragment is often used combination which consists of several steps. Thus, "Dialog with condition" fragment consists of two steps. The first step is "Dialog", which reflects the dialogue window with buttons and fields for entering of data. The second step is "Condition (If .. Else)" , which rules the order of keyboard macro executing in dependence on executing or non-executing of the given condition in it. In "Dialog with condition" fragment the clicking of button "Yes" is a condition.

  • Choose step "Dialog" and add the text field "Customer name" into the dialogue with the "+ Field" button. Notice that it is necessary to save the entered data in variable "{name}".
  • Adding new field

IMPORTANT NOTE: Variable in MouseRobot keyboard recorder is the special line which consists of letters and numbers. It doesn’t include blanks. And it is enclosed in braces. Such line may serve like pseudonym for fragment of text or the other data. While executing, MouseRobot keyboard recorder will substitute value of variable instead of its name automatically.

  • Now, by analogy with "Customer name", we’ll add "Agreement date" field and settle variable "{date}" for it. As well we’ll change the title of dialogue for more sensible one.
  • Dialog properties

On the base of this information MouseRobot keyboard recorder will create and reflect the following dialogue window on the display while executing:


  • Now in keyboard macro, it is necessary to change "John Smith" for "{name}" and "12 July 2010" for "{date}". For example, we have to change the name under which the file is saved from "Agreement with John Smith" for "Agreement with {name}".
  • Variables

  • Add "Stop task" as the last trait. It will be the step which is executing in case of choice of "No" in the dialogue.
  • Stop task

Macro is ready!

In addition to keyborad macro recording, MouseRobot provides the comfortable ways of their invocation and executing. Using task scheduler which is built-in MouseRobot keyboard recorder you may execute macro with just one click or one combination of buttons!


It is possible to use the methods of automation which are shown here for any other tasks and programs. Brevity and clearness of representation of task for automation in MouseRobot guarantee simplicity of changing and adding the recorded macros.

Download and try MouseRobot right now! It is completely free of charge!

Make the step to the incensement of your own efficiency passing computer the boring tasks!


Bookmark & Share


Subscribe to Blog

AutomationBox Blog



View all


I love MouseRobot! An actual macro style recorder that operates by function rather than by cursor location. This is way easier to use and understand than any other macro program.
Aitken Rendell, technical support consultant

I am web developer and typically I have a lot of programs open. With MouseRobot I can run the single script, and a few seconds later my work area is ready to go! This is amazing!
Phill Judd, web developer



November 11, 2010
New Feedback System


October 16, 2010
MouseRobot 2.0 released!

Download Now!


June 24, 2010

MouseRobot 2.0
(beta-version) available


June 21, 2010

Site design changed!


News Archive >>