Sending an ID to Word when automating from VBScript

H

hals_left

Is there anyway to do this ?

I have a button on the Intranet page to automate a word template on the
client:

<script language="Vbscript">
Set objWord = CreateObject("Word.Application")
Set objDocument = objWord.Documents.Add ("myTemplate.doc")
</script>

But no way to pass a record id from the same screen.

So i have to code a userform in Document_New() and collect an id from
the user mnaually.

Is there no way to pass the ID to Word ? Or read it from word from a
cookie on the client machine.

Thanks
hals_left
 
C

Cindy M -WordMVP-

Hi Hals_left,
I have a button on the Intranet page to automate a word template on the
client:

<script language="Vbscript">
Set objWord = CreateObject("Word.Application")
Set objDocument = objWord.Documents.Add ("myTemplate.doc")
</script>

But no way to pass a record id from the same screen.

So i have to code a userform in Document_New() and collect an id from
the user mnaually.

Is there no way to pass the ID to Word ? Or read it from word from a
cookie on the client machine.
Theoretically, you could use objWord.Application.Run to pass parameters
to a public Sub in the Word project (Word 2000 and later). You can give
that a try, but note you may need to check out all the different ways a
macro can be called with this method (full project "path", full file
path).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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