Sending ASP Session Variable to Word Macro

Discussion in 'ASP General' started by Colin Steadman, Jan 19, 2004.

  1. 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>
    Colin Steadman, Jan 19, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Kwan

    How to Call Word Macro in ASP.NET

    Brian Kwan, Oct 18, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    1,479
    Brian Kwan
    Oct 18, 2005
  2. Dead RAM
    Replies:
    20
    Views:
    1,106
    John Harrison
    Jul 14, 2004
  3. D Senthil Kumar

    macro name from macro?

    D Senthil Kumar, Sep 20, 2003, in forum: C Programming
    Replies:
    1
    Views:
    576
    Jack Klein
    Sep 21, 2003
  4. chowchho
    Replies:
    7
    Views:
    627
    Patrice
    Mar 28, 2008
  5. John Reye
    Replies:
    14
    Views:
    775
    Tim Rentsch
    May 8, 2012
Loading...

Share This Page