Results 1 to 2 of 2

Thread: Writing Word documents from ASP - URGENT!!

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    Slovenia
    Posts
    40
    Hello
    I'm trying to open word document from VB Script in ASP to
    replace some words in document.

    Here is my source code:

    <%
    Dim MyDoc
    Dim WordObject
    Dim Sel
    Set WordObject = CreateObject("word.application")
    Set MyDoc = WordObject.documents.Open("c:\Inetpub\osp\doc\narocilo2.doc")
    Set Sel = WordObject.Select
    MyDoc.Application.Visible = False
    MyDoc.Activate
    Sel.GoTo wdGoToLine, wdGoToAbsolute, 1
    Sel.Find.ClearFormatting
    Sel.Find.Replacement.ClearFormatting
    With Sel.Find
    .Text = "#*#"
    .Replacement.Text = cStr(request("id"))
    .Forward = True
    .Wrap = wdFindAsk
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = True
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    End With
    Sel.Find.Execute 1, True, wdFindContinue
    MyDoc.Save
    MyDoc.Close

    Set MyDoc = Nothing
    Set WordObject = Nothing
    %>

    Text is not replaced.
    Can somebody help me!

    Tomaz

  2. #2
    Addicted Member
    Join Date
    May 2000
    Posts
    142

    i also want to know

    let me know when you get this working.

    i tried to do something very similar.
    worked fine in VB. could not get it going in ASP.



    dvst8
    Secret to long life:
    Keep breathing as long as possible.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width