Solved

VBA "AutoNew" doesn't start rhe macro

Posted on 2006-07-17
13
965 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
[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
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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 article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

623 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