?
Solved

Insert autotext via a makro

Posted on 2014-11-24
2
Medium Priority
?
101 Views
Last Modified: 2014-11-24
I have a makro that unprotects a document, goes to the end of the document, and then reprotects the sheet, wich works great when I specify the text in the makro. However, I want to assign an autotext instead, so here is my try. Could you fix the autotext part, since that is the only thing not working properly:

Thanks a lot

Sub Macro3a()
    Dim aDoc As Document
    Dim strPassword As String
   
    strPassword = ""
    Set aDoc = ActiveDocument
    If aDoc.ProtectionType <> wdNoProtection Then
        aDoc.Unprotect strPassword
    End If
    aDoc.Bookmarks("\EndOfDoc").AutoTextEntries ("Schaetzung 1")
    aDoc.Protect Type:=wdAllowOnlyFormFields, Password:=strPassword
 End Sub
0
Comment
Question by:mvp1985
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 40463893
Hi,

pls try

        Application.Templates(aDoc.AttachedTemplate.FullName). _
        BuildingBlockEntries("Schaetzung 1").Insert Where:=aDoc.Bookmarks("\EndOfDoc").Range

Regards
0
 

Author Comment

by:mvp1985
ID: 40463902
Works great. Thanks a lot
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question