DELI-LINKER
Enrich
the texts you write in Word with automatic references to YOUR OR ALL delicious
favorites (including yours in first place if you are registered at Del.icio.us)
The
effort of accumulating thousands of favorites and tags must not be wasted. Here
you have a way to use your delicious memory plus a big crowdmemory
as a prompter when you try to develop an idea by writing
The macro for that purpose automatically takes every word defined as a
tag in your favorites, searches for it in your text, and, if found, inserts in
that term a link pointing just to those favorites containing that tag.
You have the option to make the links to point to ALL relevant
favorites
At the end I include also a small macro for removing all the links in the text whenever you want.
See below the VB code of the macros, together with the instructions
about the way to organize the tags in a text file in your c: drive.
CODE:
Sub
delitags()
Dim
tag, url, delilink As String
Dim
longi, e As Integer
url = http://delicious.com/YOURUSERNAMEINDELICIOUS/
‘ url = http://www.delicious.com/search?p=
‘ ACTIVATE THIS INSTEAD OF THE LINE BEFORE IF YOU WANT TO SEARCH IN ALL
DELICIOUS USERS
e
= 1
For
e = 1 To 2
'
If
e = 1 Then Open "c:\deli\keywo.txt" For Input As #1 ' another list of
keywords not (necessarily) included in your delicious tags
If
e = 2 Then Open "c:\deli\tags.txt" For Input As #1
Do
While Not EOF(1)
Line Input #1, tag
longi = Len(tag)
If longi < 3 Then GoTo 99
delilink = url
& tag
On
Error GoTo 99 '
tag = " "
& tag & " "
Selection.HomeKey
Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = tag
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do While Selection.Find.Execute = True
If tag = Selection Then
Selection.Delete
ActiveDocument.Hyperlinks.Add
Anchor:=Selection.Range, Address:= delilink, SubAddress:="",
ScreenTip:="", TextToDisplay:=tag
End If
Loop
99
Loop
Close
1
Next
77
e = e
End
Sub
Sub
RemoveAllHyperlinks()
Dim
i, nume As Integer
nume =
ActiveDocument.Hyperlinks.Count
'MsgBox
nume
For
i = nume To 1 Step -1
ActiveDocument.Hyperlinks(i).Delete
Next
i
End
Sub
You will have to put all your tags in a file “c:\deli\tags.txt”, just one
tag by line, for example:
economics
politics
web
youtube
.
.
For that purpose, I advise you to go to delicious and:
- choose “create tag bundle”
- Select All in the screen
- Copy the selection and paste it in a notepad file
- select just the tags in the text file
- go to Word
- paste the tags
- convert the text in a 2 columns table
- select + copy the left column with the tags
- paste it in a notepad virgin file
- save that file as “c:\deli\tags.txt”
For any suggestions, you may contact me at criterce@hotmail.com
12 March 2011
<