FAQ

Frequently asked questions for self help.

Knowledge base article 102

How to run a macro as an application starts/Autoexecute macros

Autoexecute macros, that start when a file is loaded, are not allowed in Ability due to security problems - such functionality provides an easy route to spread viruses.

However, it is possible to create a shortcut that opens a file and runs a macro as the application loads.

The general format is:

ApplicationName FileName#Macroname
ApplicationName #Macroname

The first starts the Ability application, opens the file Filename and runs the macro called Macroname that is contained within the file.

The second starts an Ability application and runs the Application or Global level macro called Macroname.

Example 1. Suppose you want to open a database called INVOICE.ADB in My Documents and run a macro called STARTINV within the database:

  1. Right click over your Desktop and select New/Shortcut (or, to put it inside the Start menu, right click on the Start button, select Open, select Programs and right-click and select New/Shortcut).
  2. Click Browse and open up My Documents
  3. Select INVOICE.ADB and OK.
  4. After the name of the file, add #STARTINV so that line now reads something like:
    "C:\Documents and Settings\Phil\My Documents\INVOICE.ADB#STARINV"
  5. Click Next and complete the shortcut
Example 2. Start Write and run an Application macro called STARTUP:
  1. Right click over your Desktop and select New/Shortcut (or, to put it inside the Start menu, right click on the Start button, select Open, select Programs and right-click and select New/Shortcut).
  2. Click Browse, open up My Computer and browse to c:\program files\ability office 4
  3. Select ABWRITE.EXE and OK.
  4. After ABWRITE.EXE (and after any quotation marks), add a space and then #STARTUP so the line reads:
    "C:\Program Files\Ability Office 4\ABWRITE.EXE"   #STARTUP