• Autotext in Word 2010 – extract/export contents

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Autotext in Word 2010 – extract/export contents

    Author
    Topic
    #481103

    I have a custom template set up in Word 2003, and brought successfully thru Word 2007 and now in Word 2010. Over the years it’s accumulated a few hundred Autotext entries, which have always worked fine, no problems.

    I now need the contents of the individual Autotexts for entry into an Excel spreadsheet [Excel 2010] which I need to upload to an external company. The format etc of the spreadsheet in not changeable or negotiable, it feeds into auto-systems on their end.

    Is there some way to ‘dump’ the entire contents of the Autotext ‘container’ held in my template? Get them all in a text file would be fine–it would be great if they could also have their name adjacent to the text block, but I’ll take anything which gets them out of the ‘box’ and into easily findable and editable ‘open ground’.

    I’m trying to avoid a laborious one-by-one “Insert Autotext > Type name of Autotext above it > Repeat” a few hundred times.

    Lugh.
    ~
    Alienware Aurora R6; Win10 Home x64 1803; Office 365 x32
    i7-7700; GeForce GTX 1060; 16GB DDR4 2400; 1TB SSD, 256GB SSD, 4TB HD

    Viewing 2 reply threads
    Author
    Replies
    • #1315213

      If you create a new document based on your template, and then run the following code, it will insert into the document all of the autotexts contained in the template, preceded by the autotext name.

      Code:
      Sub InsertAllAutotexts()
         Dim ATE As AutoTextEntry
         For Each ATE In ActiveDocument.AttachedTemplate.AutoTextEntries
            Selection.TypeText ATE.Name & vbCrLf
            ATE.Insert Where:=Selection.Range, RichText:=True
            Selection.TypeParagraph
         Next ‘ATE
      End Sub

      Gary

      • #1425313

        I am really interested in this!!
        I have over a thousand entries in Autotext from Word 2003 that I would dearly love to export to Excel without having to do it manually!
        How do I run the code mentioned in the previous message?
        Thanks
        Mal

    • #1315224

      Gary, you are so right, thank you very much! You saved me a lot of time 🙂

      Lugh.
      ~
      Alienware Aurora R6; Win10 Home x64 1803; Office 365 x32
      i7-7700; GeForce GTX 1060; 16GB DDR4 2400; 1TB SSD, 256GB SSD, 4TB HD

    • #1425436

      Thanks a mill Charles.

      I setup the Macro according to these instructions but I got the error “cant execute code in break mode”….any suggestions?
      I have clicked “enable all macros” and “Trust access to VBA..” in macro security
      Our Autotext is in the normal template of word 2010, which I brought across from Word 2003.

      Thanks
      Mal

    Viewing 2 reply threads
    Reply To: Autotext in Word 2010 – extract/export contents

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: