Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hidden Bookmarks

    I know Word uses hidden bookmarks for various things (like cross-references). Can I create a hidden bookmark for my own purposes?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 28 Times in 27 Posts

    Re: Hidden Bookmarks

    There doesn't appear to be any way to set a Visible property for Bookmark objects.

    If any of Word's built-in bookmarks could be used for your purposes, that of course would be hidden.

    Or you could create your own bookmarks, and programatically set the users' View Bookmarks option to Off! (we don't want 'em to be able to see that stuff anyway, do we?)

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,549
    Thanks
    3
    Thanked 149 Times in 142 Posts

    Re: Hidden Bookmarks

    A hack would be to create a cross reference to the item you want as a hidden bookmark. This then creates a hidden bookmark to that item. Then delete the cross-reference and the hidden bookmark remains. Then you can go about using it for your own purposes.

    You may need to make it a numbered item to allow you cross-refer to it.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    knoway
    Guest

    Re: Hidden Bookmarks

    Hi,

    The following code will do the job:

    Sub CreateHiddenBookmark()
    '
    ' Macro to create a hidden bookmark under user control
    '
    Dim Message As String, Title As String, Default As String
    Message = "Enter the bookmark name" ' Set prompt.
    Title = "Hidden Bookmark Insertion" ' Set title.
    Default = "Mark" ' Set default.
    Dim strBookMark As String
    strBookMark = InputBox(Message, Title, Default) 'Get user input
    With ActiveDocument.Bookmarks
    .Add Range:=Selection.Range, Name:="_" & strBookMark 'Underscore makes it hidden
    .DefaultSorting = wdSortByName 'Place it in sort sequence (if it is made visible)
    .ShowHidden = False 'Turn off display of hidden bookmarks
    End With
    End Sub

  5. #5
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 28 Times in 27 Posts

    Re: Hidden Bookmarks

    Good work, Dave.
    Methinks we have to give Jonathan West (MS public newsgroup MVP) a credit for this solution, eh?[img]/w3timages/icons/cool.gif[/img]

  6. #6
    knoway
    Guest

    Re: Hidden Bookmarks

    Absolutely!!!

    What goes around, comes around [img]/w3timages/icons/wink.gif[/img]

  7. #7
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Bookmarks

    Out of curiosity, what would be the use of creating a hidden bookmark?

    Thanks in advance.

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Bookmarks

    Thanks Dave and Jonathan and Gary...

    This will work except for one thing. The Range (the actual text I want referenced by the bookmark) needs to be hidden in an autotext entry. The hidden bookmark hides the bold brackets of the bookmark, but not the text ranged.[img]/w3timages/icons/frown.gif[/img]

    Capital bit of code though. That underscore makes for a nice piece of VBA lore.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Bookmarks

    Phil, et. al:

    That's a fair question. Here's what I'm trying to do: I've got various autotext pieces in a template. These autotext pieces need to be named, some with very long names -- too long for the actually autotext name. That name ends up on the subject line of a memo created from the template. I either have to write code to insert the full subject text for each autotext name or embed that name into the autotext. I have tested the hidden bookmark code. It works for hiding the bold brackets of a bookmark, but not the text range -- so, it won't work. Got any ideas???
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  10. #10
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Bookmarks

    Gary,

    See my post to Phil below. And get your brain ready to help me out here. Thanks.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  11. #11
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,549
    Thanks
    3
    Thanked 149 Times in 142 Posts

    Re: Hidden Bookmarks

    Can you store the long title in the first paragraph of each autotext and then insert the complete autotext and then move the first paragraph into your title area?

    Or store double autotexts (Title and Body) and add that to the code which populates the form. eg "autotextname" & "Title" in the subject area and "autotextname & "Body" in the body area.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  12. #12
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Bookmarks

    Thanks, Andrew. That sounds like a workable solution.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  13. #13
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Bookmarks

    Hi Kevin:
    When you get this working, would you post an example with the code. It sounds interesting.

    Thanks.

  14. #14
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Bookmarks

    Phil,

    Off-topic- but congratulations on you new title.

    Nobility?

    I shall be careful with the warts.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  15. #15
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Bookmarks

    Hi Geoff:
    Thank you very much.[img]/w3timages/icons/blush.gif[/img] I intend to remain as humble as ever[img]/w3timages/icons/crazy.gif[/img][img]/w3timages/icons/dragon.gif[/img][img]/w3timages/icons/devil.gif[/img]

Page 1 of 2 12 LastLast

Posting Permissions

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