If you have a lot of text in one Word document and if you want continue reading from the sentence when you where closing document, this will be very useful: after you put following macro you automatically form a bookmark on the place of cursor in that moment. Next time when you open a same document other macro (AutoOpen) will delete bookmark and put a cursor on the same place so that you can continue working with Word document just like you did not close it at all.
Steps:
- Open VBE ( ALT+F11)
- In Project window select Normal ( view picture abowe)
- Left click on it and Insert/Module
- You will see a new window for new module. In this window copy/paste next macro:
Sub AutoOpen()
If ActiveDocument.Bookmarks.Exists(“L_auto”) = True Then
Selection.GoTo What:=wdGoToBookmark, Name:=”L_auto”
ActiveDocument.Bookmarks(“L_auto”).Delete
End If
End Sub
Sub AutoClose()
ActiveDocument.Bookmarks.Add _
Range:=Selection.Range, Name:=”L_auto”
End Sub
- File / Save Normal.
- Close document
Author: me&Sting



Technorati Tags: Microsoft+Word, VBE, tutorials, help, office, document
