cbutton
asked on
VBA "AutoNew" doesn't start rhe macro
I asked this question in the Visual Basic area, but maybe it should have been considered a Word problem.
Please check out https://www.experts-exchange.com/questions/21913030/AutoNew-in-XP.html#17119437
All I have available is 145 points, so that's all I can offer.
Please check out https://www.experts-exchange.com/questions/21913030/AutoNew-in-XP.html#17119437
All I have available is 145 points, so that's all I can offer.
Have you tried renaming the AutoNew to DocumentNew?
ASKER
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\G roceries.d ot". Perhaps there's another way to specify the target. On the W98 system, where it works, the target is:
"C\MSOFFICE\Templates\Groc eries.dot" .
Hi JOrzech,
DocumentNew doesn't work either.
Charlie
That's exactly what I want to do. I start Word from a shortcut whose target is:
"C:\Documents and Settings\Owner\Application
"C\MSOFFICE\Templates\Groc
Hi JOrzech,
DocumentNew doesn't work either.
Charlie
Does the macro run if you access the template from File/New?
Curious: Why are you starting Word from a shortcut with a target?
Curious: Why are you starting Word from a shortcut with a target?
ASKER
> 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.
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.
So why not just put the template on the desktop instead of launching Word?
ASKER
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
What is your macro security set to?
ASKER
The minimum.
ASKER
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
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
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
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
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