Discussion:
PRB Why does Application.Scripts not work for OnAction?
(too old to reply)
ATS
2006-07-28 18:38:02 UTC
Permalink
PRB Why does Application.Scripts not work for OnAction?

I tried to make a command bar button and set its OnAction to call script I
added with Application.Scripts. And I failed. I asked on MSDN and was told
OnAction for a command bar button can not call the script added via
Application.Scripts.Add.

So, I'm left, why?

And for that matter, what good is Application.Scripts?
Jean-Guy Marcil
2006-07-29 03:00:30 UTC
Permalink
Post by ATS
PRB Why does Application.Scripts not work for OnAction?
I tried to make a command bar button and set its OnAction to call
script I added with Application.Scripts. And I failed. I asked on
MSDN and was told OnAction for a command bar button can not call the
script added via Application.Scripts.Add.
So, I'm left, why?
And for that matter, what good is Application.Scripts?
What code did the OnAction call executed?

In the Word VBA context, the "Application" keyword refers to Word itself.
There is no "Scripts" method/properties under the Application property in
the Word Object library. So, what are you referring to when you mention
"Application.Scripts". Do you mean VBS?
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
***@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
ATS
2006-07-31 13:51:03 UTC
Permalink
My mistake on the Application.Scripts, I meant Document.Scripts.
Jean-Guy Marcil
2006-07-31 15:21:30 UTC
Permalink
Post by ATS
My mistake on the Application.Scripts, I meant Document.Scripts.
Those scripts are meant to be used in HTML documents, either in the <head>
or in the <body>.
When the HTML page is loaded, depending on the script, it will execute
automatically, or wait for user input.

This is why you cannot call the script directly in the Word environment.

What are you trying to do?

If you are not building an HTML document, ".Scripts" is not the way to go.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
***@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Loading...