?
Solved

Launch Winword /m to run a macro  - how to use preloaded templates in Office\Startup?

Posted on 2003-03-07
5
Medium Priority
?
1,230 Views
Last Modified: 2012-05-04
Hi,

    I have a number of templates in the Microsoft Office\Office\startup folder, and would like to run one of the macros from a shell command in VB.

    So, my code says something like:

Shell "Winword.exe /mLaunchDocumentWizard"

    This launches Word, but does not run the macro. This does work if I open the document containing the macro first, but this is not an option in my app.

    Info:

The LaunchDocumentWizard subroutine compiles
The LaunchDocumentWizard is a valid macro (public sub, no parameters)


    How do I run a macro without opening the document which contains it?

Thanks,

Nik

0
Comment
Question by:NikWhitfield
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 4

Expert Comment

by:Glowman
ID: 8088708
Nik,

I haven't tried to do this, but just taking a quick glance at your code.  You need to make sure that there is a space between your command line parameter and the macro your trying to initiate.  So instead of
Shell "Winword.exe /mLaunchDocumentWizard"
Shell "Winword.exe /m LaunchDocumentWizard"

???
G
0
 

Author Comment

by:NikWhitfield
ID: 8089535
No - there is no space between the switch and the argument.
0
 
LVL 3

Accepted Solution

by:
Diveblue earned 500 total points
ID: 8096876
You need to put you macro in the normal.dot template
0
 

Expert Comment

by:CleanupPing
ID: 8900515
NikWhitfield:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9074366
Moderator, my recommended disposition is:

    Accept Diveblue's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question