Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    [SOLVED]Bookmark Create Dialog Box in a Macro

    I have to create many, many bookmarks in a document so that I can use them in different documents; however, I have been unable to activate CTRL+SHIFT+F5 to create the next Bookmark in the macro.

    I figured it would be better to create a document and if changes need to be made it is easier to make one change and then simply update the other documents without having to worry if the changes are made in the other documents or not.

    Up to now I have been copying and pasting the text in all different documents and then going to all those documents and making changes more than once, which is a total waste of my time.

    So, I created the following macro, but have been unable to figure out how to make the Create Bookmark dialog box to appear so that I create the next bookmark from the selected text.
    Code:
    Sub Format_To_Bookmark_Insertion()
    '
    ' To create bookmark from selected text
    ' Attached to CTRL+SHIFT+5
    '
        Selection.MoveDown Unit:=wdParagraph, Count:=1
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        With Selection.Find     ' Finds the special quote
            .Text = "«"
            .Replacement.Text = ""
            .MatchAllWordForms = False
        End With
        Selection.Find.Execute  ' Selects the paragraph to be bookmarked
        Selection.Extend
        Selection.Extend Character:=Chr(13)
        Selection.MoveLeft Unit:=wdCharacter, Count:=1
    
    '{I need the macro to now activate the Create Bookmark (CTRL+SHIT+F5) here so
    ' that I can create the next bookmark without having to press the shortcut}
    
    End Sub
    Thank you guys in advance.
    Last edited by vgarrim; 2014-03-06 at 13:30. Reason: Added Code Tags

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    5,826
    Thanks
    185
    Thanked 704 Times in 642 Posts
    Vgarmin,

    I added code tags to your macro. I noticed that you had the first line of your macro commented out. Was this intentional for testing or an accidental comment? HTH
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  4. #3
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have been experimenting; it was an accident.
    After the bookmark dialog box appears and I create the new bookmark, when I have to create the next one, the first thing I want the macro to do is go to the next paragraph so that I do not have to do.

  5. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    5,826
    Thanks
    185
    Thanked 704 Times in 642 Posts
    Ok, I edited the code to remove the commented line.
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  6. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,435
    Thanks
    3
    Thanked 125 Times in 118 Posts
    Dialogs(wdDialogInsertBookmark).Show
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  7. #6
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you. It did the trick.

Tags for this Thread

Posting Permissions

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