VBA code for searching text in MS FrontPage

Author Message
parth13

  • Total Posts : 6
  • Scores: 0
  • Reward points : 0
  • Joined: 8/5/2010
  • Status: offline
VBA code for searching text in MS FrontPage Tuesday, August 17, 2010 8:57 PM (permalink)
0
Hi Guys,
Looking for a VBA code for MS FrontPage which will search for a text in a webpage (open in the edit mode in FrontPage), Select that text and assign a hyperlink to that. The code below works for MS word but not for FrontPage. Please help. Thanks
 
Sub Hlink()
Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "Daily Report"
        .Replacement.Text = ""
        .forward = True
        .wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = True
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
        "http://fileview/ "& _
        VBA.Format(VBA.Date, "YYYYMMDD") & "_daily.html", _
        SubAddress:="", ScreenTip:=""
End Sub
 
#1
    rasimmer

    • Total Posts : 2363
    • Scores: 163
    • Reward points : 0
    • Joined: 3/19/2009
    • Location: Cedar Rapids, IA
    • Status: offline
    Re:VBA code for searching text in MS FrontPage Wednesday, August 18, 2010 1:55 AM (permalink)
    0
    When you're working with Office Apps, the best thing you can do is record a macro, do the function manually, and then look at the VBA code in the macro.  However, this is VBScript forum, not Visual Basic for Applications.  So, if the macro recording doesn't help, you'd do better to post to a VBA forum for your answer.
     
    #2
      parth13

      • Total Posts : 6
      • Scores: 0
      • Reward points : 0
      • Joined: 8/5/2010
      • Status: offline
      Re:VBA code for searching text in MS FrontPage Wednesday, August 18, 2010 8:29 PM (permalink)
      0
      rasimmer


      When you're working with Office Apps, the best thing you can do is record a macro, do the function manually, and then look at the VBA code in the macro.  However, this is VBScript forum, not Visual Basic for Applications.  So, if the macro recording doesn't help, you'd do better to post to a VBA forum for your answer.


      Thanks for the Info rasimmer. Ironically, FrontPage doesn't have feature to record Macro. Anyways, I'll put it to VBA forum.
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9