|
|
Microsoft Word 2003 Visual Basic macros
Most of these are essentially identical to the
WordBasic 6.0 versions, from which they were converted with little or no additional modifications or enhancements.
Stand-alone macros generally useful within MSWord
- Strip extra whitespace from a file
- Remove leading, trailing, or internal whitespace from the lines of a file.
-
- Embedded control
characters
- Old archived disk files sometimes contain embedded control characters
such as printer control codes. These macros allow you to manipulate
embedded control codes: strip them out, make them visible, convert them to
printable characters, or embed new ones.
-
- Carriage returns
- Manage carriage returns in a file. Change WordStar soft carriage returns
to Word paragraph marks. Remove unwanted extra carriage returns from a file. Easily
modified to do other transformations.
-
- Strip backspace characters from a file
- Old disk files containing text from modem capture buffer routines often contain embedded
backspace characters
intermingled with the characters they backspaced over. Example: this^H^Hese.
This macro removes the backspace characters and the characters they
backspaced over, leaving only the final-form text.
-
- Mapdown (strip) parity bits in a file
- Yet another routine to zero bit 8 (parity) of all chars in file so all
chars have ASCII values < 128. For cleaning up log files of modem sessions.
-
- Edit a C or C++ file in MSWord
- Makes it easier to edit a C or C++ file in Word. It attaches my
CPROGRAM.DOT template to the current document, making its CPP toolbar and macros
available, changes the font to Courier New 10 (a monospaced font), and sets
the tab stops to 1/3" (4 spaces). One of the macros in CPROGRAM.DOT allows
reformatting the entire file for improved readability.
-
- Miscellaneous macros
- Miscellaneous small macros: AllCapitals makes a selection all capitals;
DocMaximizeToggle can be assigned to key F5 so Word toggles Maximize/Restore
like the Borland IDE; SETBookmarkTEMP, GOTOBookmarkTEMP, and
MoveBlockToBookmarkTEMP moves a currently selected block to bookmark TEMP;
Grep does a Grep-like search (well, sort of) within the active document;
TabIn tabs in a line or block, using TAB chars; TabOut tabs out a line or
block, by removing TAB chars; ScrollTextDown, ScrollTextUp,
ScrollToWindowBottom scroll the document window without moving the cursor;
QuoteFirstString and ToDatabase do some simple processing of text before
importing into a database.
Microsoft Word 2003 Templates:
Each of these pages lists macro code from a Word .dot template and
also has a download link for obtaining the template itself.
-
CPROGRAM.DOT
- A template containing several macros that fix up, reformat, beautify C,
C++, and ASM source files.
-
Macros that are parts of other site projects:
- AI.DOT
- A complex set of macros used by the
RECORDS.MDB database project for extracting data from free-form text and
transferring it into the correct fields of the database. A few of the subs
and functions might have some usefulness in Word macros that are not
database-related. Several of them demonstrate methods for using SQL and DDE
in WordBasic.
-
|