Remember And Return To Last Edited Line In Word Document
By creating a simple macro it is now easier to find out the last edited line in Microsoft Word. Now you can be start from the exact same line where you stopped writing, after reopening a closed document. Microsoft Word 2010 enables users to write macros to integrate their own functions to be applied over the document.
To get started with writing such a function, launch Microsoft Word 2010 and open a document.
Now navigate to Developer tab. (In case you don’t find Developer tab, go to File menu, click Options, and in left pane click Customize Ribbon, from right pane enable Developer check-box. Click OK to to see Developer tab on the ribbon).
Now click Visual Basic.
Visual Basic window will open, in the left pane, click on ThisDocument, Visual Basic editor will appear. Now copy these lines of code and paste in the VB editor.
Sub AutoOpen()
‘
‘ GoToMyBookmarkText
‘
‘
On Error Resume NextSelection.Find.ClearFormatting
With Selection.Find
.Text = “**************”
.Replacement.Text = “”
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
ActiveWindow.SmallScroll Up:=15End Sub
Sub AutoClose()
‘
‘ CreateMyBookmark
‘
‘
Selection.TypeText Text:=”**************”
End Sub
Once pasted, exit from VB editor. and save the document as Macro Enabled document(go to File menu and hit Save As).
From Save as type options, click Word Macro-Enabled Document (*.docm), and click Save.
Now close the Word document. Upon opening the same document you will be automatically taken to the last line edited and an asterisk(*) will be shown (which actually shows that you were editing this line earlier).
[via TheFreeWindows]
Well, very nice, but using Shift+F5 should go to last edited line, also when opening saved document
.Execute FindText:=”**************” yea thats the change
I can’t believe you made me do work in VB to make this current .. but I needed it. Multiple times day so I fixed it for anyone else who used to have a handy LITTLE macro to do this: NOTE My mod doesn’t clear the asterisks added automatically but I’m not about to spend any more of my times researching VB ‘A’ …sorry:
Sub AutoOpen()
‘ GoToMyBookmarkText — not a method name but a Comment Go Figure !!?!?
On Error Resume Next
Selection.Find.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute FindText:=”**************”
.Replacement.Text = “”
End With
Selection.Find.Execute
ActiveWindow.SmallScroll Up:=15
End Sub
Sub AutoClose()
‘CreateMyBookmark same as above I was looking for a magic method but this is a comment
Selection.TypeText Text:=”**************”
End Sub