Discussion on:
View:
Show:
You could do that I suppose, but these can be used in the same work session.
That's the most heavy-handed attempt at avoiding proper tools in word that I've ever seen. Just use the "INSERT BOOKMARK" feature. You can easily setup multiple points to jump around in your document. And there are built in key-strokes and toolbar buttons already created. You just have to use them.
The simplest bookmark is to simply close the document where you are working. When you return use CTL+F5 to return to that spot. As you work the document this "bookmark" shifts to the last place you worked. Useful for taking a break from the computer, or moving to a task in other software.
But this "solution" addresses moving to different spots in the document while you're working. The shortcut F5 doesn't really do that.
What if the user doesn't want to close the document to take advantage of that -- it's good to know that capability exist and I'm glad you mentioned it, but these are used differently. You'd use them with, not instead of the built-in bookmarking feature. And keep in mind, these macros are constantly updated as the user works.
I did a lot of proofreading on my wife's papers when she was in graduate school. I often needed to inquire of her about meanings before I would change something. Simplest method I came up with was just to use 3 X's at the beginning of the word/phrase/paragraph/whatever. When I got with her and came back to it, Ctrl+F would find it (them, if multiples) immediately. It was so simple and fast, I would probably still use it.
I use a macro called "Find_zzz" to temporarily bookmark a place. This can be easily recorded if you have macros enabled, but you MUST use Advanced Find in the navigation pane. A simple Ctrl F find will not work.
For temporary place-holders (you can of course use as many zzzs as you want in a doc) this maybe a better option than using macros to insert and locate a bookmark.
Or paste the following into your macros module in VBA
Sub Find_zzz()
' Find_zzz Macro
Selection.Find.ClearFormatting
With Selection.Find
.Text = "zzz"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
End Sub
For temporary place-holders (you can of course use as many zzzs as you want in a doc) this maybe a better option than using macros to insert and locate a bookmark.
Or paste the following into your macros module in VBA
Sub Find_zzz()
' Find_zzz Macro
Selection.Find.ClearFormatting
With Selection.Find
.Text = "zzz"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
End Sub
The macros only work with one placeholder at a time, so I guess if you're working with multiple placeholders, this would work well, except, you have to remember to remove the zzzs, right?
However, the good thing is that when you click the "Find zzz" macro button on the quick access toolbar, it goes to and selects the next zzz, so it is simple matter to click delete, then click on to the next one if you want. I seldom use more than 2 or 3, but it is useful for toggling between two (or more) locations in a document and can avoid having to split the screen.
Interesting that a simple Ctrl F find won't record keystrokes in saving a Word 2010 macro and the need to use advanced find. Any idea why? Ctrl F works ok in Excel.
Interesting that a simple Ctrl F find won't record keystrokes in saving a Word 2010 macro and the need to use advanced find. Any idea why? Ctrl F works ok in Excel.
i use a similar macro except that it also creates a copy of the document for me as well.
sure i could manually create a book mark and manually save myself a second copy of the document, and sure i could manually goto my book mark when i reopen the document. and of course i could also rely on words built in document back up feature.
but why do all this work when a simple button on the quick access toolbar can accomplish all of this and provide me with the added assurance that i am preserving my hard work?
try it out:
Sub SaveToTwoLocations()
Dim oDoc As Document
Dim strFileA As String
Dim strFileB As String
Dim strBackupPath As String
'Define the backup location
strBackupPath = "e:\Backups\"
On Error Resume Next
Set oDoc = ActiveDocument
With oDoc
'Mark the cursor position with a bookmark
.Bookmarks.Add Range:=Selection.Range, Name:="OpenAt"
.Save
strFileA = .FullName
strFileB = strBackupPath & "Backup " & .Name
.Close 'Close the document
End With
FileCopy strFileA, strFileB 'Copy the document
Documents.Open strFileA 'Reopen the original document
ActiveWindow.View.Type = wdPrintView
'and restore the cursor position
ActiveDocument.Bookmarks("OpenAt").Select
End Sub
sure i could manually create a book mark and manually save myself a second copy of the document, and sure i could manually goto my book mark when i reopen the document. and of course i could also rely on words built in document back up feature.
but why do all this work when a simple button on the quick access toolbar can accomplish all of this and provide me with the added assurance that i am preserving my hard work?
try it out:
Sub SaveToTwoLocations()
Dim oDoc As Document
Dim strFileA As String
Dim strFileB As String
Dim strBackupPath As String
'Define the backup location
strBackupPath = "e:\Backups\"
On Error Resume Next
Set oDoc = ActiveDocument
With oDoc
'Mark the cursor position with a bookmark
.Bookmarks.Add Range:=Selection.Range, Name:="OpenAt"
.Save
strFileA = .FullName
strFileB = strBackupPath & "Backup " & .Name
.Close 'Close the document
End With
FileCopy strFileA, strFileB 'Copy the document
Documents.Open strFileA 'Reopen the original document
ActiveWindow.View.Type = wdPrintView
'and restore the cursor position
ActiveDocument.Bookmarks("OpenAt").Select
End Sub
It's also possible to set Word to automatically make a backup copy (with a *wbk extension) of your document. That means that you have to save the document while you're working on it, but I do that automatically anyway because I've lost too many docs for a variety of reasons, so I'm pretty obsessive about making backups. But I like your creative and intelligent solution to two problems with one macro.
yeah, i recall so many nights fussing over lost documents and the time and energy creating them, because office and windows decided to be unreliable when you least expect it. what is also useful is google doc's because it saves revisions and drafts.
I'm an editor and work on up to 6 different papers every day. I have a macro called "Stopped here". The green words are highlighted in violet, a color I don't use for any other purpose. That's what works for me. I've been doing that for about 15 years. Yes, I have to delete those words. No, I don't have to do a "Find" search for them (but I can if I want to) because of the unique color, plus I usually remember approximately where I stopped in the paper (that's because I do it in installments, labeled section by labeled section, and then label and date each section that I email to my clients). Having to deal with an MS Word bookmark is too time-consuming for me. I use the bookmark function only when I need to ask the author to look at two different parts of the paper that don't appear on the same page and so can't be pointed to using a drawing bar arrow (which won't stretch across pages).
Press Alt > N > K
And it all there already in the Microsoft Office. isn't it?
And it all there already in the Microsoft Office. isn't it?
That launches the bookmark dialog. Then, you then have to stop and enter a bookmark name. Then, it's a few keystrokes to then return to that bookmark later. I think a couple of clicks on the QAT are a lot more efficient!
A much simpler solution is to type an otherwise unused character, such as ` or ~ and then just search for it. I use it all the time.
Also, remember that when you close a document, Word places a token at the cursor position. When you reload the document, you can jump to that position with Ctrl-Alt-Z.
Also, remember that when you close a document, Word places a token at the cursor position. When you reload the document, you can jump to that position with Ctrl-Alt-Z.
I use *, which I insert at every location in reports I am writing where I need to edit or add more information later. Easy when you are finalizing the doc to search for *, edit the text, then remove all asterisks. But I still use my "Find zzz" macro as a temporary place marker. Bookmarks are great for cross-referencing but no use for temporary place marking.
As someone mentioned earlier, why not use actual bookmarks ... or if you're using the Styles for Heading1-3 ... and have the View > Document Map on, you can easily jump to new sections in one click.
Why not just use the Bookmark function built into Word, then Control G to move to the bookmark(s)? One can use as many bookmarks as required as long as each has a unique name. No macros, no fiddling with VBE.
F5 is already built in to Word. It takes you back 3 edits. It also marks your place if you close out of a document. When you open the document again, F5 takes you to where you left off.
That's useful and thanks for mentioning it -- but this macro doesn't do the same thing, although, it will often seem to. With this macro, you can go anywhere, do anything, for any length of time -- and return to a specific spot, not one of the last three edits you made. What if you've made many edits? But, I'm glad you mentioned this -- definitely worth sharing! Thank you!
The macro proposed in this article is limited to the currently active document. On the other hand, if you create the macros by recording the actions that have the same effect, you can assign the macro to normal.dot and have them available in any document. For example, I recorded these 2 macros:
Sub BookmarkTemp_Insert()
'
' BookmarkTemp_Insert Macro
'
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:=" Temp_Bookmark"
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
End Sub
Sub BookmarkTemp_ReturnTo()
'
' BookmarkTemp_ReturnTo Macro
'
Selection.GoTo What:=wdGoToBookmark, Name:=" Temp_Bookmark"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
End Sub
Sub BookmarkTemp_Insert()
'
' BookmarkTemp_Insert Macro
'
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:=" Temp_Bookmark"
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
End Sub
Sub BookmarkTemp_ReturnTo()
'
' BookmarkTemp_ReturnTo Macro
'
Selection.GoTo What:=wdGoToBookmark, Name:=" Temp_Bookmark"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
End Sub
- Keyboard Shortcuts:
- Prev
- Next
- Toggle

































