Microsoft Script Editor in Word 2003

T

Tosca

Hi everyone

I'm familiar with the VBA editor (Alt + F11) in Word 2003 and Excel 2003 to
edit code or a macro. I've been introduced recently to the Microsoft Script
Editor (Alt + Shift + F11) in the same applications. I've been advised that
I can use this to edit and debug Visual Basic Script but I've run into
problems using it. I've opened the VB Script via the Editor and hoped to
step therough it (as I would if I had code in Word or Excel) but it won't do
so. When I press F11 to step into the code, it doesn't do so. I've tried
F5 to run the code which causes the indicator on the blue bar at the top of
the pane to change from "design" to "run" and the pane changes slightly but
then everything return to as it was. The code should result in message
boxes being produced but that doesn't happen. Similarly, if I type
something into the Immediate Pane, the response is "The expression cannot be
evaluated whilst in design mode".

I'm not sure if there's a problem with the editor (I've tried repairing from
the installation disc) or if I'm misusing it. I've done a lot of googling
but can't find explicit instructions dealing with how to use the editor!
I've tried asking a similar question on a VBS forum but that's not resulted
in a solution. I felt it appropriate to ask on a Word forum as I access
this editor from Word 2003.

Does anyone have any suggestions which will allow me to use this editor to
write and debug VB Script?

Thanks for your patience!
 
M

Marc Adams [marcmyword.com]

Hi Tosca,

I've been programming in Word since Word95 and have been working with 2003
since it's inception. I never knew about the editor. You can teach an old dog
new tricks.

Tell me, do you have Visual Studio installed? I think you may actually
jumping into that environment. If so, then you'll have to set a reference to
the Word object. I'm very interested in what you're doing. Perhaps we can
discover some of this together.

If you'd like to go further with this exploration, please feel free to email
me at (e-mail address removed).
 
T

Tosca

Hi Marc

Like you, I have been codiong in Word and Excel intermittently for a couple
of years but not to a high level. I was astonished when I stumbled across
the editor!

I don't have Visual Studio installed. I can open a .vbs file with the
Editor but it always goes to the design mode and some of the text is
displayed in blue, but there is not "instinctive" response by the editor, as
there is when writing VBA for Word or Excel. I've managed to get into debug
mode by Start>Run>wscript //x <full path and name of vbs file>. This gives
a familar screen with a yellow bar with which I can step through the code
with F11. Unfortunately, I've not found out how to stop the code and retain
it in this window for editing! If I need to edit the code, I go back to
Notepad, resave it as a .vbs file and then Start>Run.... again.

"Marc Adams [marcmyword.com]"
 
B

Bob Buckland ?:-\)

Hi Tosca,

The MS Script Editor is an Office 2000, Office XP(2002) and Office 2003
installation option. It's basically the HTML/XML 'source'
editor for Word documents (without the Visual Studio Environment)
and for Outlook forms work. You can use the Editor for
scripting, Cascading Style Sheets, etc
http://office.microsoft.com/en-us/assistance/HP052353781033.aspx

Word documents can contain scripts, but they don't run in
the Word document environment (same limitation as using an
animated GIF - Word knows it runs, but relies on an outside
engine to keep things secure.)

Having said that <g> there are some bug issues with the
Script Editor within Word
http://support.microsoft.com/default.aspx?scid=kb;en-us;840184&FR=1

========
Hi everyone

I'm familiar with the VBA editor (Alt + F11) in Word 2003 and Excel 2003 to
edit code or a macro. I've been introduced recently to the Microsoft Script
Editor (Alt + Shift + F11) in the same applications. I've been advised that
I can use this to edit and debug Visual Basic Script but I've run into
problems using it. I've opened the VB Script via the Editor and hoped to
step therough it (as I would if I had code in Word or Excel) but it won't do
so. When I press F11 to step into the code, it doesn't do so. I've tried
F5 to run the code which causes the indicator on the blue bar at the top of
the pane to change from "design" to "run" and the pane changes slightly but
then everything return to as it was. The code should result in message
boxes being produced but that doesn't happen. Similarly, if I type
something into the Immediate Pane, the response is "The expression cannot be
evaluated whilst in design mode".

I'm not sure if there's a problem with the editor (I've tried repairing from
the installation disc) or if I'm misusing it. I've done a lot of googling
but can't find explicit instructions dealing with how to use the editor!
I've tried asking a similar question on a VBS forum but that's not resulted
in a solution. I felt it appropriate to ask on a Word forum as I access
this editor from Word 2003.

Does anyone have any suggestions which will allow me to use this editor to
write and debug VB Script?

Thanks for your patience! >>
 
T

Tosca

Thanks Bob - someone has suggested that I use Visual Studio. I may go for
that as Im getting more and more interested in scripting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top