Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How to make doc's FullName into an AutoText entry without first inserting it into document
This macro works fine. It temporarily Inserts Fullname of the active document into the document and makes that string an AutoText entry called MyDocName, which is used later by another macro to reactivate this document from another document. This enables me to return instantly to this document without having to open the Window menu or scroll through the open documents. But I wonder if there is a more efficient way of doing it, so that the active document's FullName doesn't actually have to be inserted into the document as a range, but rather the FullName becomes an AutoText entry in one step. It seems that would make the macro a little faster. Any ideas? Thanks. Larry .. Sub DocFullNameStore() Application.ScreenUpdating = False Dim X As Long, Y As Long Dim r As Range X = ActiveDocument.Range.End - 1 ActiveDocument.Range.InsertAfter ActiveDocument.FullName Y = ActiveDocument.Range.End - 1 Set r = ActiveDocument.Range(Start:=X, End:=Y) NormalTemplate.AutoTextEntries.Add Name:="MyDocFullName", Range:=r r.Delete End Sub |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
simple word question | New Users | |||
Autotext exclusive to a New Document Template I Create in Word 200 | Microsoft Word Help | |||
auto current date entry in your document | Microsoft Word Help | |||
Inserting a hyperlink - Place in this document | Microsoft Word Help | |||
Using Hyperlinks in Mail Merge IF...THEN...ELSE Statements | Mailmerge |