Sending ASP Session Variable to Word Macro

C

Colin Steadman

Apoligies if this post appears twice, but my first attempt at posting
it was hours ago and there is still no sign of it in the forum (says
five minutes in the confirmation message).

=============================================================================

I have some sample code from Microsoft that allows me to start a
specific Word template at the click of a button from within an ASP
page. I would like to modify this in such a way that I can pass an
ASP Session variable to a macro inside the template. Is this actually
possible?

The ASP page (copied below) opens the template, and the AutoOpen macro
is fired displaying a simple msgbox. All I need now is to pass the
macro a Session variable and I'm done, but I'm having great difficulty
finding the correct method to achieve this.

If this isn't possible could someone please put me out of my misery!

TIA,

Colin

<html>
<head>
<title>Start Word Template Test</title>
<script language=vbscript>
Dim objWord

Sub button_onclick()
Call OpenDoc("http://server.domain.net/website/wordtemplate.dot")
End Sub

Sub OpenDoc(strLocation)
Set objWord = CreateObject("Word.Application")
objWord.Visible = true
objWord.Documents.Open strLocation
End Sub
</script>
</head>

<body>

<input type=button name=button value="Create Letter">

</body>
</html>
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top