Call some JScript code from within Word VBA?

M

mccaskey

I have been given a JavaScript routine of 2000 lines. It's basically a
big function that takes in a string and returns another. I need this
same function within a VBA macro in Word.

I'd rather not rewrite the whole thing in VBA (especially since the
JavaScript will be updated occasionally). Can I instead call the
JScript engine, give it the input string and get back the result
string?

I see Microsoft_JScript in the list when I click Tools > References.
Can this do what I need? If so, where can I learn how to use it?

I'm working in Word 2007 and only need my macro to work in 2007. But I
can't require users to install anything not in a stock Office 2007
installation or already installed with Windows and Internet Explorer.

Thanks for any leads!
John
 

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