|
-
Jul 12th, 2000, 06:43 AM
#1
Thread Starter
Member
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
-
Jul 12th, 2000, 07:44 AM
#2
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|