Writing Script inside a Word Document

W

Wamiq Ansari

Hi,

I want to know about writing a simple script inside a Word Document. If any
work has been done on such thing and where I can find more information?

Basically, I want to be able to write simple scripting (IF Else, For Loops,
While Loops) in a Word document. When an interpreter reads this document it
should be able to identify the script and run it. For example, If a user
wants to repeat a particular paragraph 10 times, then he/she should be able
to mark the paragraph with a 'For Loop' that repeats the paragraph 10 times
in a Word Template Document.

Any help suggestions are most welcome.

regards,

Wamiq Ansari
(e-mail address removed)
 
C

Charles Kenyon

You are, I think, talking about programming using Visual Basic for
Applications (vba) which is built into Word. Take a look at the MVP FAQ
(below). It has a separate list of pages on vba and macros. You may also
want to look at the page on userforms.

Before starting to program Word, though, you should learn its native
interface including styles and AutoText. Otherwise, you'll spend weeks or
months trying to either program something that is already built into Word or
trying to program against or over a built-in feature that will undo what you
are doing.

Once you get started writing code, post in the vba.beginners newsgroup for
help or with questions.
--

Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
W

Wamiq Ansari

Thanks for your reply,

I think what I am looking for might be bit different than what VBA offers.
With VBA one generates code to programe some functionality into Word
Application itself (for example, automate some daily tasks). Correct me if
I'm wrong but Add-ins and Macros are generated using VBA code.

What I'm looking for is writing raw IF statements and For Loops inside the
actual Word .dot template and using some interpreter to read such IFs and
For Loops. I would like to know if such a simple scripting language with an
interpreter exists to do this.

I'm sure VB script is simple enough to be used for such task, but has anyone
ever tried to achieve such thing to generate documents.

regards,

Wamiq Ansari
(e-mail address removed)
 
C

Charles Kenyon

Nope, what you are looking for is what vba offers. Vba is kept in templates
or documents. It can be used to add functions to the entire application,
yes. It can also be used to program the function of a particular template
and the documents based on that template.
--

Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top