Firstly, Mouser is clearly one of the greatest individuals of all time! I hope it is known to anyone or anything that ever lives with Mouser that he is never to be hassled with thing like sock pickup, dish cleaning, or anything else at that level.
I was wrong about being able to open a MS-Word document scrolled to a particular bookmark. I could only get it to work from hyperlinks inside Word documents, not from arbitrary/html url's outside Word. "file:///recipes.docx#bookmark_name" opens the file, but ignores the bookmark. Many fruitless hours of forum scanning behind this conclusion despite this dated KB article:
http://support.microsoft.com/kb/310520.
Ultimately, I wrote a script to take the name of a bookmark on the command-line. It opens recipes.docx scrolled to that bookmark. RecipeOpen.vbs:
Option Explicit
Dim objWord
Dim currentDocument
set objWord = CreateObject("Word.Application")
objWord.DisplayAlerts = 0
objWord.visible = true
objWord.Documents.Open "c:\!projects\recipes.docx", false, False '(path, confirmconversions, readonly)
If WScript.Arguments.Count = 1 Then
set currentDocument = objWord.Documents(1)
currentDocument.Bookmarks(WScript.Arguments.Item(0)).Select 'bookmark to bottom of screen
objWord.ActiveWindow.LargeScroll 1 'scroll down 1 frame
objWord.ActiveWindow.SmallScroll -3 'scroll back a few lines (bookmark to top of screen)
Else
MsgBox "No bookmark name passed to RecipeOpen.vbs"
End If
objWord.Application.Activate 'move focus to ms-word ;(
Second script RecipeBookmarks.vbs scans my recipes.docx file for bookmarks and creates RecipeBookmarks.txt just as Mouser described above. Each line contains: search text | url, such as "Top Drawer Seafood Chowder | c:\!Projects\RecipeOpen.vbs link20". Got to remember to run this guy whenever I add a new recipe to the docx file.
Option Explicit
Dim objWord
Dim currentDocument
Dim bmk
Dim fs
Dim f
Set objWord = CreateObject("Word.Application")
objWord.DisplayAlerts = 0
objWord.Documents.Open "c:\!projects\recipes.docx", false, True '(path, confirmconversions, readonly)
Set currentDocument = objWord.Documents(1)
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.CreateTextFile("c:\!Projects\RecipeBookmarks.txt", True)
For Each bmk In currentDocument.Range.Bookmarks 'replace trims newlines
f.WriteLine(Replace(bmk.Range.Text, vbCr, "") & " | c:\!Projects\RecipeOpen.vbs " & bmk.Name)
Next
currentDocument.SaveAs "c:\temp\recipes.htm", 8
currentDocument.Close
Set currentDocument = Nothing
objWord.Quit
Set objWord = Nothing
f.Close
Set f = Nothing
Lastly, inside FARR > Options > Aliases/Keywords/Groups I opened myaliases.alias and created a new Alias with the Trigger/Keyword set to "recipes" and the Result(s) set to "recipes | #filecontents C:\!Projects\RecipeBookmarks.txt".
Works like a charm! Mouser for president!!
Thanks for all the great tools and support!