Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    QuickParts (Word 2007)

    Over several months the QuickParts gallery has accumulated about 100 labels. I have indeed created many, many labels, but to my knowledge I have not added them to the building blocks collection. When I click on Quick Parts on the Text group of the Insert tab, there are entries named "ToolsCreateLabels1" through "ToolsCreateLabels98".

    I created various label sheets with the macro recorder running so that I could determine the LabelID for each of the labels, since the LabelID is required to create a label in VBA... not the label number (e.g. 5164 for Avery label 5164) as in previous versions of Word. It appears that an AutoText entry was added each time I created a label. (The QuickPart does not, however, add a label to my document.)

    I can make all of these go away by deleting Normal.dotm, but I'd like to determine how to do this with VBA, assuming there will be similar situations in the future. I can't determine whether I should work with BuildingBlocks, QuickParts, AutoText or what. They seem to be child objects of NormalTemplate. If I run the macro recording while deleting one of these items from the Building Block Organizer, the resulting code has 3 building blocks added, but nothing deleted.

    Does anyone have experience with these hard to kill annoyances?

  2. #2
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: QuickParts (Word 2007)

    I've discovered what was going on. If I create a label sheet in the usual fashion (Mailings>Create>Labels), I get a new document with the specified label. If, however, the macro recorder is running, AutoText entires (two!) get created at the same time. They are named ToolsCreateLabels1 and ToolsCreateLabels2. As more labels are created with the macro recorder running, additional AutoText entries are added. Reason? That remains a mystery.

    I was able to delete these QuickParts with VBA code. AutoTextEntires is a child collection of NormalTemplate, although Intellisense does not display AutoTextEntires after typing the dot after NormalTemplate, nor is AutoTextEntries found in the Object Browser. The following code functioned well for me, but I had to type it without the assistance of Intellisense. That's not a difficult task, but the lack of help from Intellisense is a bit misleading.

    Dim at as AutoTextEntry
    For Each at In NormalTemplate.AutoTextEntries
    at.Delete
    Next

    Once this code is run, the entires no longer dispaly under QuickParts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •