|
|
Microsoft Word 6.0 WordBasic macros
In the code listings, the heading of each section is the macro's name;
the text just after is the short descriptive text that you can put in the description field of Word's "Macros"
dialog box, and everything after is the code.
Stand-alone macros generally useful within MSWord
All these pages contain code listings of macros from my Normal.dot,
but there's no point providing my Normal.dot template here. Create your
own macros and paste the provided code into them.
- 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 6.0 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.
-
-
HELPFILE.DOT template
- Provides a starting point for building the .RTF
file used by the Help Compiler to create a Windows 3.1-style WinHelp
file. It contains a macro that partially automates the creation of the
footnotes that are required. Has both Word 6.0 and Word 2003 versions.
-
Macros that are parts of other site projects:
- AI.DOT
- Code listings of 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. The AI.DOT template itself is in the RECORDS.MDB project
download package.
-
|