Re: MS WORD MACRO PUZZLER

Subject: Re: MS WORD MACRO PUZZLER
From: "Nagai, Paul" <pnagai -at- VISA -dot- COM>
Date: Thu, 13 Jul 1995 11:05:00 PDT

I didn't look too hard at this, so it may not exactly meet your needs, but
it does
give you control over the default contents of the "text" box ...

I took the following from a WordBasic help sample, check out the
help topic, InputBox$() for higher level details:

============================================================
InputBox$() Examples

This example asks the user to type a word,
which is assigned to the variable word$. You could
use this variable in a macro that
counts the occurrences of a given word in the active document
(as in the example for EditFindFound()).

word$ = InputBox$("Count instances of:", "WordCounter")

The following example prompts the
user to type a number from 1 to 10. InputBox$() returns what
the user types as a string, which the
Val() function converts to a number to assign to the numeric
variable num. Note that if the user spells
out "Ten" instead of typing "10," Val() returns 0.

num = Val(InputBox$("Type a number from 1 to 10:"))

This example asks the user to type two lines,
which are assigned to the variable a$. The InStr()
function checks for a newline character;
if one exists, the Left$() and Right$() functions are used
to redefine a$ without the newline character.

a$ = InputBox$("Type two lines:")
newline = InStr(a$, Chr$(11))
If newline <> 0 Then
a$ = Left$(a$, newline - 1) + Right$(a$, Len(a$) - newline)
End If

============================================================

I think you may have to adjust your macro logic some to accommodate
the different funcional logic, but I think it will allow you to do what you
want.

------
Paul Nagai
Visa International
pnagai -at- visa -dot- com
415-432-1101
415-432-3678 fax


Previous by Author: Re: Document Numbering
Next by Author: Re: Peer Reviews
Previous by Thread: MS WORD MACRO PUZZLER
Next by Thread: Re: MS WORD MACRO PUZZLER


What this post helpful? Share it with friends and colleagues:

Sponsored Ads


Sponsored Ads