By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,366 Members | 1,366 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,366 IT Pros & Developers. It's quick & easy.

Sending ASP Session Variable to Word Macro

P: n/a
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>
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.