Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Crate a Hyperlink from selected Text
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 22nd April 01:35
william main
External User
 
Posts: 1
Default Crate a Hyperlink from selected Text



I find that I end up pasting a lot of URLs in to a page as
i am designing it. I then need to select it and convert it
to a link with the insert hyperlink command.

click a menu item I created which envokes my code.

My code follows:

Option ********

Sub CreateLink()
Dim oSelected As IHTMLSelectionObject
Dim oTextRange As IHTMLTxtRange
Dim strLink As String

Set oSelected =
FrontPage.Application.ActiveDo***ent.Selection
Set oTextRange = oSelected.createRange
strLink = oTextRange.Text
oTextRange.execCommand "CreateLink", False, strLink
End Sub

I also added a menu item under the Help menu to bring up
the Frontpage SDK help file. It follows:

Public Sub FPSDK()
Call Shell("C:\WINDOWS\hh.exe d:\FPSDK\FPSDK.chm",
vbNormalFocus)
End Sub

Both of these should me in a module. Then you can add the
macros to menu items by right clicking on the Menu in FP
and selecting Customize.
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666