I was looking for a simple and easy way of inserting XFN relations into links. I
usually use MS FrontPage for my blog writings. So I mocked up this XFN Link
creator VBA macro. Here is how I did it.
Create a macro called CreateXFNLink and insert the code below (copy paste it
into Notepad first to get rid of the HTML mark-up).
| Public Sub CreateXFNLink() Dim objRange As IHTMLTxtRange Set objRange = ActiveDocument.Selection.createRange If Len(objRange.Duplicate.Text) |
Now create a form like the one below called UserForm1. Put necessary
checkboxes, a button and a text box to enter the link on the form.
And here is the code for the Create button:
| Private Sub CommandButton1_Click() ‘<a href=”http://blog.example.com/” rel=”friend met”>A Friend</a> Dim link As String Dim objRange As IHTMLTxtRange Set objRange = ActiveDocument.Selection.createRange link = “<a href=””” If CheckBox1 link = Mid$(link, 1, link = link & “””>” & objRange.Duplicate.Text & “</a>” objRange.pasteHTML link Unload Me |
When you select a text in the FrontPage run the macro CreateXFNLink and
select the relations that you want to implement and enter the hyperlink that you
want to link and hit the Create button. Your link will be created with all the
XFN relations that you have selected.
Happy blogging.
