How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Network Engineer Your Own Question

Network Engineer
Network Engineer, Computer Hardware Engineer
Category: Computer
Satisfied Customers: 197
Experience:  30 Years Experience Hardware and Software Support,Mac OS X, Expert.
Type Your Computer Question Here...
Network Engineer is online now
A new question is answered every 9 seconds

How do I start MS Word from the command line using the /m ...

Customer Question

How do I start MS Word from the command line using the /m command line switch to run a mcro that is not in the normal.dot template?
Submitted: 7 years ago.
Category: Computer
Expert:  Network Engineer replied 7 years ago.
/m Starts a new instance of Word without running any AutoExec macros.
what you want is

/mmacroname Starts Word and then runs a specific macro. The /m switch also prevents Word from running any AutoExec macros.
so it would be

C:\Program Files\Microsoft Office\Office\Winword.exe /mmacroname


http://support.microsoft.com/kb/210565
Network Engineer, Computer Hardware Engineer
Category: Computer
Satisfied Customers: 197
Experience: 30 Years Experience Hardware and Software Support,Mac OS X, Expert.
Network Engineer and 17 other Computer Specialists are ready to help you
Customer: replied 7 years ago.
This works fine for macros that are in the normal.dot global template; however, I am trying to reference a macro in another template that I have placed in the startup directory for Word and it still refuses to work. I had thought there was some way to specify the actual location of the macro such as template.module.macro but that failed too.
Expert:  Network Engineer replied 7 years ago.
/ttemplatename Starts Word with a new document based on a template other than the Normal template.

thats about it accourding to there support site.
You used to be able to do that in the older versions,Word.Template.x, where x represents MS-Word version .... Macro.1, Microsoft Access module macro, Can contain malicious behavior so they stopped people from doing it.
Customer: replied 7 years ago.
The /t and /m switches cannot be used together and there are numerous macros within the template rather than any autoexec macro.
Expert:  Network Engineer replied 7 years ago.
The DOT template is the first document opened when you launch MS Word.

If a macro named AutoExec is in the "normal.dot" template or in a global template stored in Word's startup directory, it is executed
Customer: replied 7 years ago.
Would I then somehow use the autoexec macro to launch the desired macro within the other module based on the document name or do I need to create numerous global templates each with an autoexec macro and specify them on the startup line acordingly depending on the document I am loading? I got an autoexec macro to work in the global template I had created (not normal.dot) but it doesn't want to launch the macro I really want to run; perhaps I am referencing it incorrectly on the application.run command or should be trying another command.

Thanks for all your help.
Expert:  Network Engineer replied 7 years ago.
rename normal.dot to backup.dot and name yours normal.dot and see if that works.

I did see this tho om the support site.
When you run a Visual Basic For Applications macro containing the "Application.Run Macroname:=" command in Microsoft Word or in another Office program to automate Word, you may receive the following error message:
Run Time error '4366' : Unable to run the specified macro.

CAUSE
You have included a template name as part of the Macroname argument string.
Back to the top

RESOLUTION
Remove the template name from the Macroname argument.

http://support.microsoft.com/kb/190235
Customer: replied 7 years ago.
I have been able to create an autoexec macro in the global template and it works fine when I specify that template name using the /t switch on the command line as long as it is located in my startup directory. Unfortunately, it does not work if I open any other document by double clicking on it or simply try opening Word. The macro assigns the activedocument.name value to a variable which is then used to determine which other macro to run. This now creates a run-time error 4248 (command is unavailable because there is no document open). If I move the template from the startup directory to another location, the problem goes away but the autoexec macro will not run even with the /t switch (even if it is my templates directory). Now I need a awy around this run-time 4248 error and am not having any luck finding it on any microsoft support sites including MSDN.

I've tried the workarounds that are suggested on the Microsoft site using the error handler to trap the error and exit the macro; however, this completely defeats the purpose of having an autoexec macro. I will now see what happens if I comment out the entire autoexec macro and call the individual macros by name with the template still in the startup directory but have my doubts.

Any ideas?

I'm paying now as my initial question has been answered.

Thank you.
Expert:  Network Engineer replied 7 years ago.
Found it here for you..
as how to fix it is beyond me .
http://support.microsoft.com/kb/813983

Run-time error '4248':
This command is not available because no document is open.
Back to the top

CAUSE:
This problem may occur if you do not have a document open, or if the document that you are referencing is not open. Word can only change the properties of an open (or visible) document.

Note These error messages may also appear if you open the document with the Visible property set to False.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • I am very happy with my very fast response. Eric is very knowledgeable in the subject area. Thank you! RP Austin, TX
  • Hi John, Thank you for your expertise and, more important, for your kindness because they make me, almost, look forward to my next computer problem. After the next problem comes, I'll be delighted to correspond again with you. I'm told that I excel at programing. But system administration has never been one of my talents. So it's great to have an expert to rely on when the computer decides to stump me. God bless, Bill Bill M. Schenectady, New York
  • The Expert answered my Mac question and was patient. He answered in a thorough and timely manner, keeping the response on a level that could understand. Thank you! Frank Canada
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
 
 
 

Meet The Experts:

 
 
 
  • Andy

    Computer Consultant

    Satisfied Customers:

    5311
    11yr exp, Comp Engg, Internet expert, Web developer, SEO
< Last | Next >
  • http://ww2.justanswer.com/uploads/EN/Engineer1010/2012-6-9_132423_jaj12a.64x64.jpg Andy's Avatar

    Andy

    Computer Consultant

    Satisfied Customers:

    5311
    11yr exp, Comp Engg, Internet expert, Web developer, SEO
  • http://ww2.justanswer.com/uploads/BA/barrenrock/2011-10-19_215925_JamesJAFinal.64x64.jpg James's Avatar

    James

    Sr. Computer Support Expert

    Satisfied Customers:

    8376
    20 years of experience building, fixing and servicing PCs and operating systems.
  • http://ww2.justanswer.com/uploads/zeyank/2009-09-26_154244_P8110079.png Ryan H.'s Avatar

    Ryan H.

    Computer Support Specialist

    Satisfied Customers:

    1741
    A+ Certified Technician - 10 Years experience working with all types of computer systems.
  • http://ww2.justanswer.com/uploads/JA/jadedangel57/2011-11-8_193134_janenewsm.64x64.jpg Jane Lefler's Avatar

    Jane Lefler

    Sr Prog Analyst / Technician

    Satisfied Customers:

    0
    Computer Programmer / Technician/ Consultant 16+ years
  • http://ww2.justanswer.com/uploads/RO/robmpreston/2013-9-23_233814_mijiFZm.64x64.jpg RPI Solutions's Avatar

    RPI Solutions

    Support Specialist

    Satisfied Customers:

    3476
    5+ Years in IT, BS in Computer Science
  • http://ww2.justanswer.com/uploads/BA/barunrath/2012-7-5_201954_Profilepic2.64x64.jpg B. Rath's Avatar

    B. Rath

    Computer Support Specialist

    Satisfied Customers:

    8671
    Certified Computer/Networking Support Specialist.
  • http://ww2.justanswer.com/uploads/FS/fszcze/2012-6-18_181848_500test.64x64.jpg Frederick S.'s Avatar

    Frederick S.

    Computer Specialist

    Satisfied Customers:

    7240
    Computer technician and founder of a home PC repair company.