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)
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
|
|
|
|
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)
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.
|
|
|
|
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)
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.
|
|
|
|