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

RE: VBA Scripting by capnhud

capnhud
Tue Jun 12 10:49:02 CDT 2007

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

"capnhud" wrote:

> 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

Re: VBA Scripting by Omar

Omar
Thu Jun 14 05:53:35 CDT 2007

On 12 juin, 17:49, capnhud <capn...@discussions.microsoft.com> wrote:
> Does anyone have a possible suggestion. Or is what I am trying to do not
> possible?
>
>
>
> "capnhud" wrote:
> > I have tried to use a macro in Frontpage 2003 that would allow me to wh=
en 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 =3D ActiveDocument.Selection.createRange
> > temp =3D objTxtRange.htmlText
> > temp =3D "<p>" _
> > & temp & "</p>"
> > objTxtRange.pasteHTML temp
> > End Sub- Masquer le texte des messages pr=E9c=E9dents -
>
> - Afficher le texte des messages pr=E9c=E9dents -

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