Results 1 to 12 of 12
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Shortcut to part of a document

    Hi

    How do you create a Windows shortcut going to part of a document (for example, to a bookmark in a Word document, or a specific tab in an Excel spreadsheet)?

    Note: If you display the properties of an existing shortcut, then press F1, a message appears indicating that it IS possible to do, this but I can't find anything saying how to do it.)

    Thanks
    Dale

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Shortcut to part of a document

    There is a way to do this with a GUI inside a Word document, but I gather you want this shortcut to launch from somewhere else. What happens if you use the usual filepath#bookmark syntax?

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Long Beach, California, USA
    Posts
    1,912
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shortcut to part of a document

    Hmmm... isn't the ".shb" extension / DocShortcut File Type defined as a "Shortcut into a document"???

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Shortcut to part of a document

    Yes, I'm trying to do it from outside the document.

    I tried "C:...filename#bookmark.doc" and "C:...filename.doc#bookmark", but Windows says the filename is not valid.

    Dale

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Shortcut to part of a document

    Que?

    Dale

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Shortcut to part of a document

    I get the same thing. There should in theory be a way to do this with WordBasic-like DDE, but it's too hideous to think about at this hour.

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Long Beach, California, USA
    Posts
    1,912
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shortcut to part of a document

    Well... the .shb extension is defined by Microsoft as a "Windows Shortcut into a document". What does that mean? Your guess is as good as mine. Almost 100% of the Internet literature on this extension involves the exploitation of it -- and NOT the valid use of it. How is it used as a "Shortcut into a document"? I don't know.

  8. #8
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Shortcut to part of a document

    I tried this various ways. If you create hyperlink in Word doc to another Word doc, it'll look like this:

    file:///C:AccessBookMark Test.doc#Part5

    This does not work as a desktop shortcut, the file will open but will not go to bookmark. You can create an IE "Favorites" shortcut like this:

    file:///C:/Access/BookMark Test.doc#Part5

    Or, as desktop shortcut:

    "C:Program FilesInternet Exploreriexplore.exe" file:///C:/Access/BookMark Test.doc#Part5

    This will open the doc (usually after a warning), and go to bookmark - but in the IE browser window, not in Word.... <img src=/S/frown.gif border=0 alt=frown width=15 height=15> The only way I know to create a Windows shortcut that goes to specific location in document is to use technique described in MSKB Article 212344:

    WD2000: How to Create a Document Shortcut on Your Desktop

    To quote article:

    "1. Open an existing document.
    2. Select the text (or space) to which you want to create a shortcut.
    3. Right-click the selected text, and then drag it to the desktop.
    4. When you release the right mouse button, click Create Document Shortcut Here on the shortcut menu that appears.
    5. Save and close the document."

    This will create a socalled "Document Shortcut" on desktop (resembles a scrap document). When you look at the document shortcut properties, the file name & path are not specified anywhere, though obviously saved internally somewhere. So there's apparently no way to create one of these things other than by drag & drop. As with "normal" shortcuts (.lnk files), the file extension does not appear in Windows Explorer, but in a MS-DOS Command window appears as ".shb". The shortcut does work as advertised - in my test it opened Word doc and went to the location in doc that was "dragged" to desktop.

    HTH

  9. #9
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Long Beach, California, USA
    Posts
    1,912
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shortcut to part of a document

    Thanks, Mark. That is the first time I have seen to SHB file explained! It does work as advertised -- it creates a shortcut into the document with the selected area highlighted.

    The SHB file that gets created holds the path data inside it. However, the actual file must be modified (at least on my computer) to allow this to work. If you don't let the file be modified, the Shortcut does not work.

  10. #10
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Shortcut to part of a document

    Very useful. I'd never come across this before. A quick test shows that the shortcut still worked correctly even after I moved the original document to a different folder.

    StuartR

  11. #11
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Shortcut to part of a document

    I never really knew about this either till saw the question. As noted there does not appear to be any (easy) way to create one of these .shb shortcuts programatically, as opposed to drag & drop, if that should be desired. The Windows Script Host (WSH) provides an simple-to-use CreateShortcut method. To quote MSDN description:

    "The CreateShortcut method creates a WshShortcut object and returns it. This method can be used to create a new shortcut or open an existing one to modify its properties. A Windows shortcut must have the extension ".lnk". If the shortcut title ends with ".url", a WshURLShortcut object is created."

    So your options with this method are limited to standard .lnk & .url shortcuts. It may be possible to create an .shb type document shortcut programatically using the underlying Windows API, but I imagine the code required to do so (if possible at all) would not be simple, nor pretty.... <img src=/S/frown.gif border=0 alt=frown width=15 height=15>

  12. #12
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Shortcut to part of a document

    What a nice Christmas present. Thanks, Mark.

    By the way:
    <UL><LI>In the test I did, the process created a bookmark in the Word document called "OLE_LINK2".
    <LI>In Excel you can't drag-and-drop. But you can do it like this:
    <UL><LI>Selecting your target cell or range
    <LI>Edit/Copy
    <LI>Alt+Tab to Windows Explorer
    <LI>Right-click and select "paste shortcut". (Creates a shortcut starting with the words "Worksheet Shortcut ...")
    <LI>Alt+Tab back to Excel and save the spreadsheet[/list][/list]Thanks again, Mark. That's going to be useful.
    Dale

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •