Solved

VBA "AutoNew" doesn't start rhe macro

Posted on 2006-07-17
13
955 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There is a feature provided by MS Word that lets you create an Table of Contents for your Word document automatically. To use this feature for other documents there are two steps involved,   1.  Prepare your document for a table of contents (he…
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 walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

912 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

23 Experts available now in Live!

Get 1:1 Help Now