1. Home
  2. MS Office

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.

macro enabled docu

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).

developer tab a

Now click Visual Basic.

visual basic 1

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 Next

With Selection.Find
.Text = “**************”
.Replacement.Text = “”
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
ActiveWindow.SmallScroll Up:=15

End Sub
Sub AutoClose()

‘ CreateMyBookmark

Selection.TypeText Text:=”**************”

End Sub

enter code 1

Once pasted, exit from VB editor. and save the document as Macro Enabled document(go to File menu and hit Save As).

save as

From Save as type options, click Word Macro-Enabled Document (*.docm), and click Save.

save as 21

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).

macro is enabled. 1

[via TheFreeWindows]

Leave a comment