VBA Scripting

C

capnhud

I have tried to use a macro in Frontpage 2003 that would allow me to when I
select a section of text it wil automatically enclose the selected text with
corresponding tags. But when I run the macro i get a runtime error 70
permission denied. Can someone tell me what I am possibly doing wrong.

here is the macro

Sub WrapSampleCode()
Dim objTxtRange As IHTMLTxtRange
Dim temp As String
' This will surround the selection
' with paragraph tags.
Set objTxtRange = ActiveDocument.Selection.createRange
temp = objTxtRange.htmlText
temp = "<p>" _
& temp & "</p>"
objTxtRange.pasteHTML temp
End Sub
 
O

Omar Abid

Does anyone have a possible suggestion. Or is what I am trying to do not
possible?







- Afficher le texte des messages précédents -

See you'd better use java script or vb script because macro are slow
and sometimes doesn't run on certain platform
Script are favorable with a web page so try using it
Omar Abid
 
Top