Afternoon world, I thought I would share three simple word macros which I love. If you don't know how to edit a macro in word, this probably isn't for you (although all you need to do is create a macro, open it to edit, and paste the code below into the "new macros" module in normal.dot), but if you do this little bit of code is just beautiful - I have it assigned to keyboard shortcuts so I can just highlight a word in a document and hit ctrl + g to google it ctrl + d to look it up in the Oxford dictionary ctrl + t to look it up in the thesauraus (I like thesaurus.com) Declare Function ShellExecute _ Lib "shell32.dll" _ Alias "ShellExecuteA" ( _ ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) _ As Long Sub DictionarySearch() Dim stUrl Dim stWord stWord = ActiveWindow.Panes(1).Selection stUrl = "https://en.oxforddictionaries.com/definition/" & stWord ShellExecute 0, "OPEN", stUrl, "", "", 0 End Sub Sub GoogleIt() Dim stUrl Dim stWord stWord = ActiveWindow.Panes(1).Selection stUrl = "https://www.google.co.uk/#q=" & stWord ShellExecute 0, "OPEN", stUrl, "", "", 0 End Sub Sub ThesaurusSearch() Dim stUrl Dim stWord stWord = ActiveWindow.Panes(1).Selection stUrl = "http://www.thesaurus.com/browse/" & stWord ShellExecute 0, "OPEN", stUrl, "", "", 0 End Sub
There are also word lists that can be downloaded, which will remain even if the sites change their URL parsing, and won't accidentally be flagged as a DOS attack. I used one in a VB.NET application a few years years ago. It sounds like a lot of data, but it's only a few megabytes for the whole English language and it processes quickly if you store it as a character tree.