Solved

VBA "AutoNew" doesn't start rhe macro

Posted on 2006-07-17
13
956 Views
Last Modified: 2008-01-16
I asked this question in the Visual Basic area, but maybe it should have been considered a Word problem.

Please check out http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21913030.html#17119437

All I have available is 145 points, so that's all I can offer.
0
Comment
Question by:cbutton
  • 6
  • 6
13 Comments
 
LVL 22

Expert Comment

by:Flyster
ID: 17123461
Hi cbutton,

There are several "Auto" macros you can use in woor. (See link) As it states "The AutoNew macro runs after you create a new document based on a current template." If that's not the action you want, you can try AutoOpen.

http://support.microsoft.com/kb/211659/

Flyster
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 17123597
Have you tried renaming the AutoNew to DocumentNew?
0
 

Author Comment

by:cbutton
ID: 17124029
Hi Flyster,

That's exactly what I want to do. I start Word from a shortcut whose target is:
"C:\Documents and Settings\Owner\Application Data\Microsoft\Templates\Groceries.dot". Perhaps there's another way to specify the target. On the W98 system, where it works, the target is:
"C\MSOFFICE\Templates\Groceries.dot".

Hi JOrzech,

DocumentNew doesn't work either.

Charlie
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 17124868
Does the macro run if you access the template from File/New?

Curious: Why are you starting Word from a shortcut with a target?
0
 

Author Comment

by:cbutton
ID: 17126070
> Does the macro run if you access the template from File/New?

Yes.

> Curious: Why are you starting Word from a shortcut with a target?

It's an application used by my wife to generate a Grocery list for shopping. She doesn't even have to know how to start Word. It gives her a dialog box which lists possible items and she selects which ones she needs and at the end it prints a grocery list.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 17130590
So why not just put the template on the desktop instead of launching Word?
0
 

Author Comment

by:cbutton
ID: 17130755
JOrzech:

If you mean put the template on the desktop instead of a shortcut to the template, I tried it. It has the same effect. It launches Word with a new document, but the macro doesn't start.
0
 
LVL 37

Accepted Solution

by:
Joanne M. Orzech earned 145 total points
ID: 17130957
Then maybe just a shortcut to Word on your desktop and create a toolbar button that calls the template so she won't have to go to File/New....that may be the best solution.  Although she'd have to click two buttons... is that a reasonable solution for you?

Word would open and she could click a button to launch the template and use the following code for the macro:

    Documents.Add Template:="C:\Documents and Settings\Owner\Application Data\Microsoft\Templates\Groceries.dot", newtemplate:=False


0
 

Author Comment

by:cbutton
ID: 17131203
No. I want it to work the same on XP as it does on W98. I've already found a solution similar to what you suggest above, but it bugs me to have an extra step.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 17132145
What is your macro security set to?
0
 

Author Comment

by:cbutton
ID: 17132959
The minimum.
0
 

Author Comment

by:cbutton
ID: 17140116
JOrzech,

I'm going to give you the points. You're the only one who attempted to solve the problem, and I'm tired of dealing with it. I went ahead and put a button on the toolbar to "run" the macro. My wife will have to put up with an extra click.

The reason I don't like this solution is that as a professional programmer for forty-seven years, I've always had the philosophy that a user should not be made to conform to a program; the program should conform to the user. But this time I'm going to go ahead and compromise my principles.

Thanks for your help.

charlie
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 17140421
Many thanks charlie:

I agree wholeheartedly with you!  If I happen to run across a solution to your problem in my journeys, I'll be sure to post it.  


Regards,
Joanne
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now