P
Peter
Hi,
I'm trying to create a VBscript in web page that either
opens up or creates a word document.
I have a onclick event that calls the following routine.
So far I've tried code along the following lines:
<script language="vbscript">
<!--
function opentr()
'Dim oWord As Variant
'Dim rep_tmplt as String
rep_tmplt = "C:filename.doc"
Set oWord = CreateObject("word.application")
With oWord
.Visible = True
.Activate
' .documents.Add template:=rep_tmplt,
NewTemplate:=False, DocumentType:=0, Visible:=True
End With
End function
-->
</script>
However, you will notice that I have commented out
several lines - that's because FrontPage throws a runtime
error - "expected end of line" when I preview. I
expected this to be straight forward, but I'm obviously
missing something, or I'm trying to do something I'm not
supposed to.
Can anyone help? I initially tried posting on the
FrontPage forum, but they suggested I try in office
developer forum instead. I hope someone here can help,
or let me know where else to try.
Any help would be appreciated.
Peter
I'm trying to create a VBscript in web page that either
opens up or creates a word document.
I have a onclick event that calls the following routine.
So far I've tried code along the following lines:
<script language="vbscript">
<!--
function opentr()
'Dim oWord As Variant
'Dim rep_tmplt as String
rep_tmplt = "C:filename.doc"
Set oWord = CreateObject("word.application")
With oWord
.Visible = True
.Activate
' .documents.Add template:=rep_tmplt,
NewTemplate:=False, DocumentType:=0, Visible:=True
End With
End function
-->
</script>
However, you will notice that I have commented out
several lines - that's because FrontPage throws a runtime
error - "expected end of line" when I preview. I
expected this to be straight forward, but I'm obviously
missing something, or I'm trying to do something I'm not
supposed to.
Can anyone help? I initially tried posting on the
FrontPage forum, but they suggested I try in office
developer forum instead. I hope someone here can help,
or let me know where else to try.
Any help would be appreciated.
Peter