Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to control FP editor from VBA? Macro needed! (FP 2000/2002)

    I feel so stupid after series of unsuccesful attempts to make just a simple macro in FP.

    All I need is to embed a selection in <span class=listing>...</span> pair of tags.

    I found FP object model so messy and unfriendly. After zillion VBA macros I've made in Excel and Word, this makes me ..... off <img src=/S/frown.gif border=0 alt=frown width=15 height=15>

    In fact, I would like to find a proper way to crack this monster down and improve my efficiency. Say, any possibilities to make a simple macro as this one and attach it to a keyboard shortcut?

    Any help will do. Tnx in advance!

    Grba
    Kikinda, YU

  2. #2
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: How to control FP editor from VBA? Macro needed! (FP 2000/2002)

    The best I can offer is <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=front&Number=86788&Sear ch=true&Forum=front&Words=webgenii&Match=Username& Searchpage=0&Limit=25&Old=allposts&Main=86788>my post here</A>. In particular take a look at the STRONG and EM macros.

    I totally agree about the ugliness of the FP object model. Us FP users who are trying to extend FP are a lonely bunch right now.

    Cheers
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  3. #3
    New Lounger
    Join Date
    Nov 2001
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to control FP editor from VBA? Macro needed! (FP 2000/2002)

    > The best I can offer is my post here

    Very interesting to see. Tnx!

    But, the struggle continues. Based on those two macros, I made something quite similar:


    Public Sub AddSpan()

    Dim myEmTextRange As IHTMLTxtRange
    Dim MkEmOn, MkEmOff, rngContent As String


    ' notice this line:
    Set myEmTextRange = ActiveDocument.Selection.createRange
    '-------------------------------------------------------

    MsgBox ActiveDocument.Selection.createRange
    rngContent = myEmTextRange.htmlText

    SpanOn = "<span class=listing>"
    SpanOff = "</span>"

    myEmTextRange.pasteHTML (SpanOn & rngContent & SpanOff)

    myEmTextRange.Select

    End Sub


    When I start macro (selection in HTML source has already been made), it crashes on a line I denoted above. I get:

    Run-time error '70':
    Permission denied

    What gives? <img src=/S/confused.gif border=0 alt=confused width=15 height=20> It's just a simple test page on my Desktop. What permission on Earth should I ask for to edit it?...

    > I totally agree about the ugliness of the FP object model.

    I do not see the way to use it on a daily basis. I don't have two hours on demistify such a BIG problem as tag embedding is. I'll be back to TextPad, as I do whenever I want to shape-up my pages.

    > Us FP users who are trying to extend FP are a lonely bunch right now.

    Why they want us to remain stupid? <img src=/S/brainwash.gif border=0 alt=brainwash width=15 height=15> Is it bad habit to jump to source HTML from time to time and speed up the work? It is quite clear that anyone HTML eXPerienced (no offense, guys) can finish the work on a page much faster by editing a source rather than diving (and diving... and diving...) in those ####### dialogs.

    As the matter of fact, I really do not know how to embed a word in <SPAN CLASS...>...</SPAN> tags using FrontPage!

    So, here I am at the beginning. <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>

    Tnx anyway.

    Grba
    Kikinda, YU

Posting Permissions

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