How to select first form field of newly pasted part of document automatically with macro
Posted on 2014-11-24
So I have a great macro that unprotects a document, goes to the end of the document, pastes an autotext, and then reproects the document. However, I need to manually tab through the form fields in order to get to the newly inserted part. So here my question: How do I get the macro to automatically advance to the first form field of the newly pasted part once I run the macro?
Here is my current macro:
Dim aDoc As Document
Dim strPassword As String
strPassword = ""
Set aDoc = ActiveDocument
If aDoc.ProtectionType <> wdNoProtection Then
BuildingBlockEntries("Schätzung 1").Insert Where:=aDoc.Bookmarks("\EndOfDoc").Range
aDoc.Protect Type:=wdAllowOnlyFormFields, Password:=strPassword