Public Sub td_Add() Dim ShortCutMenu As CommandBar Dim tdLookup As CommandBarButton Dim isThere As Boolean Dim tdLabel As String tdLabel = "Lookup Turkish Dictionary" Dim i As Integer Dim menuCount As Integer Dim placeCheck As Boolean For menuCount = 1 To CommandBars.Count placeCheck = False Set ShortCutMenu = CommandBars.Item(menuCount) If InStr(LCase(ShortCutMenu.Name), "text") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "grammar") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "spell") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "track") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "metin") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "dil bilgisi") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "klavuzu") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "izle") > 0 Then If InStr(LCase(ShortCutMenu.Name), "fields") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "heading") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "list") > 0 Then placeCheck = True End If End If End If End If End If End If End If End If End If End If End If If placeCheck Then isThere = False For i = 1 To ShortCutMenu.Controls.Count If ShortCutMenu.Controls(i).Caption = tdLabel Then isThere = True End If Next If Not isThere Then Set tdLookup = ShortCutMenu.Controls.Add( _ Type:=msoControlButton) tdLookup.BeginGroup = True tdLookup.Caption = tdLabel tdLookup.OnAction = "Lookup" End If End If Next menuCount End Sub Public Sub td_Remove() Dim ShortCutMenu As CommandBar Dim isThere As Boolean Dim tdLabel As String tdLabel = "Lookup Turkish Dictionary" Dim i As Integer Dim menuCount As Integer Dim placeCheck As Boolean For menuCount = 1 To CommandBars.Count placeCheck = False Set ShortCutMenu = CommandBars.Item(menuCount) If InStr(LCase(ShortCutMenu.Name), "text") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "grammar") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "spell") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "track") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "metin") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "dil bilgisi") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "klavuzu") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "izle") > 0 Then If InStr(LCase(ShortCutMenu.Name), "fields") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "heading") > 0 Then placeCheck = True Else If InStr(LCase(ShortCutMenu.Name), "list") > 0 Then placeCheck = True End If End If End If End If End If End If End If End If End If End If End If If placeCheck Then isThere = False For i = 1 To ShortCutMenu.Controls.Count - 1 If ShortCutMenu.Controls(i).Caption = tdLabel Then isThere = True ShortCutMenu.Controls(i).Delete End If Next i End If Next menuCount End Sub Private Sub Lookup() Dim tdSite As String tdSite = "http://www.turkishdictionary.net/index.php?word=" & Selection.Text ActiveDocument.FollowHyperlink _ Address:=tdSite, _ NewWindow:=True, AddHistory:=True End Sub