ASP to Word

Discussion in 'ASP General' started by Mojo, Aug 3, 2009.

  1. Mojo

    Mojo Guest

    Hi All

    OK I thought this would be a simple case of connecting to the Word object
    and do the same stuff I can do in vb6 desktop dev, but I know I was wrong.

    In essence, I created a desktop app that takes data from a DB, munges it and
    'pastes' this all over a Word Doc template and although this works fine,
    I've got to make the whole app web based to save my sanity! Problem is
    doing the old VBA app to Word thing doesn't appear to be a good thing and
    info seems sparse on the best way to tackle this. I don't want to go down
    the 3rd party COM route as I've been stung by this before when my ISP
    wouldn't host a particular COM, so I'd appreciate any pointers anybody could
    give.

    Thanks
     
    Mojo, Aug 3, 2009
    #1
    1. Advertising

  2. Mojo

    Bob Barrows Guest

    Mojo wrote:
    > Hi All
    >
    > OK I thought this would be a simple case of connecting to the Word
    > object and do the same stuff I can do in vb6 desktop dev, but I know
    > I was wrong.
    >
    > In essence, I created a desktop app that takes data from a DB, munges
    > it and 'pastes' this all over a Word Doc template and although this
    > works fine, I've got to make the whole app web based to save my
    > sanity! Problem is doing the old VBA app to Word thing doesn't
    > appear to be a good thing and info seems sparse on the best way to
    > tackle this. I don't want to go down the 3rd party COM route as I've
    > been stung by this before when my ISP wouldn't host a particular COM,
    > so I'd appreciate any pointers anybody could give.
    >

    Since you need to work with a template, I believe you will need to use a
    third-party component like the one offered by ASPOSE for this.I used it
    and it worked very well for this purpose.

    Microsoft discourages automating Office applications in server-code.
    See:
    http://support.microsoft.com/default.aspx?scid=KB;en-us;q257757

    Alternatively, you could save that template file as html, use
    filesystemobject to open a textstream, do your replacements, and write
    the result to Response. Depending on the size of the template, this
    might work for you.

    --
    HTH,
    Bob Barrows
     
    Bob Barrows, Aug 3, 2009
    #2
    1. Advertising

  3. Mojo

    Mojo Guest

    Hi Bob

    Thanks for your reply.

    I noticed the ActiveX DLL option, but have had real problems getting this to
    work. Is it the case that I can't even use this if I using a Shared Hosting
    ISP? I would have thought the registration process is all done on the
    client rather than the server.

    My feeble failed attempt is as follows:

    <HTML>
    <HEAD>
    <TITLE>TestWord</TITLE>
    </HEAD>
    <BODY>
    <OBJECT ID="clsTestWord"
    CLASSID="CLSID:7366ED3D-A93D-404C-B971-1936C37B5DBB"
    CODEBASE="TestWord.CAB#version=1,0,0,9">
    </OBJECT>

    <SCRIPT Language="VBScript">
    clsTestWord.ShowDoc "http://myurl.com/progress.dot"
    </SCRIPT>
    </BODY>
    </HTML>

    Basically I:

    * created a VB ActiveX DLL/Class Module
    * created a public sub inside this module that basically opens up the .dot
    and displays it.
    * built the DLL
    * used the package & deploy to get the CAB and the CLSID
    * uploaded the asp file, the cab and the dot file to my host

    All I get is Object doesn't support this property or method!

    Any ideas?

    "Bob Barrows" <> wrote in message
    news:...
    Mojo wrote:
    > Hi All
    >
    > OK I thought this would be a simple case of connecting to the Word
    > object and do the same stuff I can do in vb6 desktop dev, but I know
    > I was wrong.
    >
    > In essence, I created a desktop app that takes data from a DB, munges
    > it and 'pastes' this all over a Word Doc template and although this
    > works fine, I've got to make the whole app web based to save my
    > sanity! Problem is doing the old VBA app to Word thing doesn't
    > appear to be a good thing and info seems sparse on the best way to
    > tackle this. I don't want to go down the 3rd party COM route as I've
    > been stung by this before when my ISP wouldn't host a particular COM,
    > so I'd appreciate any pointers anybody could give.
    >

    Since you need to work with a template, I believe you will need to use a
    third-party component like the one offered by ASPOSE for this.I used it
    and it worked very well for this purpose.

    Microsoft discourages automating Office applications in server-code.
    See:
    http://support.microsoft.com/default.aspx?scid=KB;en-us;q257757

    Alternatively, you could save that template file as html, use
    filesystemobject to open a textstream, do your replacements, and write
    the result to Response. Depending on the size of the template, this
    might work for you.

    --
    HTH,
    Bob Barrows
     
    Mojo, Aug 3, 2009
    #3
  4. Mojo

    Bob Barrows Guest

    Mojo wrote:
    > Hi Bob
    >
    > Thanks for your reply.
    >
    > I noticed the ActiveX DLL option, but have had real problems getting
    > this to work. Is it the case that I can't even use this if I using a
    > Shared Hosting ISP? I would have thought the registration process is
    > all done on the client rather than the server.
    >
    > My feeble failed attempt is as follows:
    >
    > <HTML>
    > <HEAD>
    > <TITLE>TestWord</TITLE>
    > </HEAD>
    > <BODY>
    > <OBJECT ID="clsTestWord"
    > CLASSID="CLSID:7366ED3D-A93D-404C-B971-1936C37B5DBB"
    > CODEBASE="TestWord.CAB#version=1,0,0,9">
    > </OBJECT>
    >
    > <SCRIPT Language="VBScript">
    > clsTestWord.ShowDoc "http://myurl.com/progress.dot"
    > </SCRIPT>
    > </BODY>
    > </HTML>
    >
    > Basically I:
    >
    > * created a VB ActiveX DLL/Class Module
    > * created a public sub inside this module that basically opens up the
    > .dot and displays it.
    > * built the DLL
    > * used the package & deploy to get the CAB and the CLSID
    > * uploaded the asp file, the cab and the dot file to my host
    >
    > All I get is Object doesn't support this property or method!
    >
    > Any ideas?
    >
    > "Bob Barrows" <> wrote in message
    > news:...
    > Mojo wrote:
    >> Hi All
    >>
    >> OK I thought this would be a simple case of connecting to the Word
    >> object and do the same stuff I can do in vb6 desktop dev, but I know
    >> I was wrong.
    >>
    >> In essence, I created a desktop app that takes data from a DB, munges
    >> it and 'pastes' this all over a Word Doc template and although this
    >> works fine, I've got to make the whole app web based to save my
    >> sanity! Problem is doing the old VBA app to Word thing doesn't
    >> appear to be a good thing and info seems sparse on the best way to
    >> tackle this. I don't want to go down the 3rd party COM route as I've
    >> been stung by this before when my ISP wouldn't host a particular COM,
    >> so I'd appreciate any pointers anybody could give.
    >>

    > Since you need to work with a template, I believe you will need to
    > use a third-party component like the one offered by ASPOSE for this.I
    > used it
    > and it worked very well for this purpose.
    >
    > Microsoft discourages automating Office applications in server-code.
    > See:
    > http://support.microsoft.com/default.aspx?scid=KB;en-us;q257757
    >
    > Alternatively, you could save that template file as html, use
    > filesystemobject to open a textstream, do your replacements, and write
    > the result to Response. Depending on the size of the template, this
    > might work for you.
    >
    > --
    > HTH,
    > Bob Barrows


    --
    HTH,
    Bob Barrows
     
    Bob Barrows, Aug 3, 2009
    #4
  5. Mojo

    Bob Barrows Guest

    Sorry, I've never attempted this. I suspect you will need to use an HTML
    Application (HTA) which is out of the scope of the ASP newsgroups. If
    you wish to pursue that route, you should read up on the subject at
    support.microsoft.com
    Mojo wrote:
    > Hi Bob
    >
    > Thanks for your reply.
    >
    > I noticed the ActiveX DLL option, but have had real problems getting
    > this to work. Is it the case that I can't even use this if I using a
    > Shared Hosting ISP? I would have thought the registration process is
    > all done on the client rather than the server.
    >


    --
    HTH,
    Bob Barrows
     
    Bob Barrows, Aug 3, 2009
    #5
    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. Laura
    Replies:
    1
    Views:
    533
    Gunnar Hjalmarsson
    Jun 5, 2004
  2. Stephen Witter

    opening a word doc in word not browser

    Stephen Witter, May 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    496
    Stephen Witter
    May 18, 2004
  3. Luis Esteban Valencia
    Replies:
    2
    Views:
    2,947
    sanjupillai
    Sep 26, 2008
  4. Sharon
    Replies:
    0
    Views:
    606
    Sharon
    Jul 27, 2005
  5. Franck
    Replies:
    1
    Views:
    4,871
Loading...

Share This Page