Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Dennis P. Dennis P. is offline
external usenet poster
 
Posts: 1
Default Can I create a Word Macro in an ASCII text format?

I have an application where I have to print many (could be up to 1500) RTF
files.
I would like to create the Word commands in an ASCII text file using
Quickbasic and then run these commands in Word - is this possible - will
Word accept an ASCII text macro file?
The commands, for example would be:

Open file1.rtf; Print; Clear
Open file2.rtf; Print; Clear
Open file3.rtf; Print; Clear ...etc, etc
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jezebel Jezebel is offline
external usenet poster
 
Posts: 1,384
Default Can I create a Word Macro in an ASCII text format?

You seem to be labouring under some misconceptions.

1. You can create a macro in Word (using Word VBA) that will print your 1500
RTF files. This is simple to the point of trivial. You will find sample code
in a squillion places on the net.

Rather than creating your instructions as a list of files, it's simpler to
point to the folder(s) containing the files, then iterate them. Total of
about 10 lines of code for your entire 1500 file corpus.

2. You can create macros as text files, then import those into Word. But
this is quite tricky. Why do you want to do this?

3. WordBasic was abandoned long ago. There is still 'sort of' backward
compatability supporting it, but there's absolutely no point creating
anything new using it. Word has used VBA since W97.


Where does QuickBasic come in?



"Dennis P." Dennis wrote in message
...
I have an application where I have to print many (could be up to 1500) RTF
files.
I would like to create the Word commands in an ASCII text file using
Quickbasic and then run these commands in Word - is this possible - will
Word accept an ASCII text macro file?
The commands, for example would be:

Open file1.rtf; Print; Clear
Open file2.rtf; Print; Clear
Open file3.rtf; Print; Clear ...etc, etc



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Dennis P. Dennis P. is offline
external usenet poster
 
Posts: 1
Default Can I create a Word Macro in an ASCII text format?

The problem is that the file names are generated randomly but I need to print
them in a specified sorted order. That's why I wanted to generate the
commands from a file list using quick basic or the commands could also be
generated from a database that we use (DOS).
The second problem is I know quick basic but don't know VBA so it's not
trivial for me.
Anyways I thought it might be easy to write an ascii script and then import
it into Word and run it - I'm pretty sure WordPerfect allows this.

Dennis P.



"Jezebel" wrote:

You seem to be labouring under some misconceptions.

1. You can create a macro in Word (using Word VBA) that will print your 1500
RTF files. This is simple to the point of trivial. You will find sample code
in a squillion places on the net.

Rather than creating your instructions as a list of files, it's simpler to
point to the folder(s) containing the files, then iterate them. Total of
about 10 lines of code for your entire 1500 file corpus.

2. You can create macros as text files, then import those into Word. But
this is quite tricky. Why do you want to do this?

3. WordBasic was abandoned long ago. There is still 'sort of' backward
compatability supporting it, but there's absolutely no point creating
anything new using it. Word has used VBA since W97.


Where does QuickBasic come in?



"Dennis P." Dennis wrote in message
...
I have an application where I have to print many (could be up to 1500) RTF
files.
I would like to create the Word commands in an ASCII text file using
Quickbasic and then run these commands in Word - is this possible - will
Word accept an ASCII text macro file?
The commands, for example would be:

Open file1.rtf; Print; Clear
Open file2.rtf; Print; Clear
Open file3.rtf; Print; Clear ...etc, etc




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default Can I create a Word Macro in an ASCII text format?

Hi ?B?RGVubmlzIFAu?=,

Anyways I thought it might be easy to write an ascii script and then import
it into Word and run it - I'm pretty sure WordPerfect allows this.

You can write a macro in a text editor, then import it into Word VB Editor, but
I can't imagine why you'd want to. All the Intellisense support that helps you
write the correct syntax would be missing. And if you don't know VBA then you'd
sure need all the support you can get. Being able to physcially type code
doesn't mean you know what you have to type...

The problem is that the file names are generated randomly but I need to print
them in a specified sorted order. That's why I wanted to generate the
commands from a file list using quick basic or the commands could also be
generated from a database that we use (DOS).

It would be possible to generate a list as a text file that a Word macro can use
to print documents (get the file names for the print command). But you can't use
text file commands in Word VBA for printing Word documents, you'd have to use
Word VBA. I recommend the word.vba.beginners group if you want to pursue this.

Possibly, you could write a batch file that uses command lines. I'm pretty sure
it's possible to use the command line + DDE to print a document (equivalent of
right-click and choosing Print in Windows Explorer), but I don't know the
syntax.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word should catalog misspelled words to study. rndthought Microsoft Word Help 39 May 21st 23 02:47 AM
take yet another lesson from wordperfect "reveal codes" wordperfect is superior Microsoft Word Help 5 May 11th 09 07:58 PM
manipulating/cutting/pasting text out of a text box [email protected] Microsoft Word Help 10 July 9th 06 10:54 PM
Macro for Letter Settings Help Renee Cabets New Users 7 May 25th 06 10:50 PM
Macros - Keyboard Commands Janet Microsoft Word Help 6 April 11th 05 05:28 AM


All times are GMT +1. The time now is 12:31 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"