Template and Macro help needed... 
Author Message
 Template and Macro help needed...

I'm trying to create an automated method of printing labels from a template.
I have a Word 2000 template file set up, data source defined (it will always
be the same file, i.e. C:\TEMP.TXT), output to printer,...  When the user
clicks the icon, I want to open the document tmeplate in Word, automatically
mailmerge to the printer, and then close the app.  Anyone have any ideas?

Chris Conner



Sat, 23 Aug 2003 00:08:56 GMT  
 Template and Macro help needed...
Hi Chris,
Have you tried recording a macro that does this?
Are you trying to connect it to a toolbar button or a macrobutton?
--
Charles Kenyon

Word New User FAQ & Web Directory:
http://www.addbalance.com/word

Legal Users' Guide to Microsoft Word (supplemented)
http://www.addbalance.com/usersguide
 --------- --------- --------- --------- --------- ---------
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.


Quote:
> I'm trying to create an automated method of printing labels from a
template.
> I have a Word 2000 template file set up, data source defined (it will
always
> be the same file, i.e. C:\TEMP.TXT), output to printer,...  When the user
> clicks the icon, I want to open the document tmeplate in Word,
automatically
> mailmerge to the printer, and then close the app.  Anyone have any ideas?

> Chris Conner



Sat, 23 Aug 2003 03:17:09 GMT  
 Template and Macro help needed...
Actually, I'm not trying to connect it to anything.  I have an application
that will create the datasource as a delimited file (CSV)  Then the app will
launch Word 2000 with the template.  Then that template should perform the
mailmerge to a printer then close the Word.


Quote:
> Hi Chris,
> Have you tried recording a macro that does this?
> Are you trying to connect it to a toolbar button or a macrobutton?
> --
> Charles Kenyon

> Word New User FAQ & Web Directory:
> http://www.addbalance.com/word

> Legal Users' Guide to Microsoft Word (supplemented)
> http://www.addbalance.com/usersguide
>  --------- --------- --------- --------- --------- ---------
> 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.



> > I'm trying to create an automated method of printing labels from a
> template.
> > I have a Word 2000 template file set up, data source defined (it will
> always
> > be the same file, i.e. C:\TEMP.TXT), output to printer,...  When the
user
> > clicks the icon, I want to open the document tmeplate in Word,
> automatically
> > mailmerge to the printer, and then close the app.  Anyone have any
ideas?

> > Chris Conner



Sat, 23 Aug 2003 04:01:41 GMT  
 Template and Macro help needed...
In that case, have you tried recording a macro in your template that does
what you want to do?

If you name that macro "AutoNew" it will run when a document based on the
template is created. If you name it AutoOpen, it will run when the template
or a document attached to the template is opened.
--
Charles Kenyon

Word New User FAQ & Web Directory:
http://www.addbalance.com/word

Legal Users' Guide to Microsoft Word (supplemented)
http://www.addbalance.com/usersguide
 --------- --------- --------- --------- --------- ---------
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.


Quote:
> Actually, I'm not trying to connect it to anything.  I have an application
> that will create the datasource as a delimited file (CSV)  Then the app
will
> launch Word 2000 with the template.  Then that template should perform the
> mailmerge to a printer then close the Word.



> > Hi Chris,
> > Have you tried recording a macro that does this?
> > Are you trying to connect it to a toolbar button or a macrobutton?
> > --
> > Charles Kenyon

> > Word New User FAQ & Web Directory:
> > http://www.addbalance.com/word

> > Legal Users' Guide to Microsoft Word (supplemented)
> > http://www.addbalance.com/usersguide
> >  --------- --------- --------- --------- --------- ---------
> > 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.



> > > I'm trying to create an automated method of printing labels from a
> > template.
> > > I have a Word 2000 template file set up, data source defined (it will
> > always
> > > be the same file, i.e. C:\TEMP.TXT), output to printer,...  When the
> user
> > > clicks the icon, I want to open the document tmeplate in Word,
> > automatically
> > > mailmerge to the printer, and then close the app.  Anyone have any
> ideas?

> > > Chris Conner



Sat, 23 Aug 2003 04:27:39 GMT  
 Template and Macro help needed...
Hi Chris,

Quote:
> Then the app will
> launch Word 2000 with the template.  Then that template should perform the
> mailmerge to a printer then close the Word.

You have two choices: if you use Charles' suggestion, then you have to use
the VB SHELL command with the DocumentName startup switch. Don't use a
template, use a plain document - because AutoNew macros won't execute when
you create a new document from a template from the command line.

OR, if your app supports OLE Automation, create an object variable for the
Word application, use GetObject or the New keyword, open the document and
RUN the macro stored in the document (that's faster than sending each
command across COM).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

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



Sat, 23 Aug 2003 21:11:44 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Need Macro for bibliography entry, technical paper template

2. help: Organizer won't copy VBA macro into Word2000 template

3. I need vc ide macro help, trying to create a move to end of word macro

4. Template help needed

5. Help needed with a template create using Word 97

6. Need Visual Basic help to export access record to text or html file template

7. wordXP save document without macro/template code

8. FileSave macro won't run in template

9. Create a Macro in word template from visual basic

10. Automatically enabling macro in a template

11. macro to ease creating email from templates?

12. Templates, Macros and Protect

 

 
Powered by phpBB® Forum Software