Solved

VBA "AutoNew" doesn't start rhe macro

Posted on 2006-07-17
13
954 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
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…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
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.

705 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

19 Experts available now in Live!

Get 1:1 Help Now