Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VBA "AutoNew" doesn't start rhe macro

Posted on 2006-07-17
13
Medium Priority
?
974 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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 580 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

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

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
Lost Word File? Eagerly, need it back? Read ahead; this File Recovery guide is for you.
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

885 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