• Listing all shape name/values in collection (Word XP)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Listing all shape name/values in collection (Word XP)

    Author
    Topic
    #432635

    I’m working on a group of documents containing multiple checkbox shapes. I’m wanting to go through each document list the shape name and value (true/false) of all shapes in the collection then move to the next document in the specified folder. HansV gave me great help in doing this same type function with bookmarks. Included is what i’m trying to start with. Any help would be appreciated. Thanks much

    Viewing 0 reply threads
    Author
    Replies
    • #1015374

      Check boxes from the Control Toolbox are inline shapes. Try the attached macro.

      • #1015382

        These are olecontrols added to the documents by;

        With ActiveDocument.Shapes.AddOLEControl( _
        ClassType:=”Forms.CheckBox.1″, _
        Anchor:=Selection.Range).OLEFormat.Object

        I’m having trouble modifying what you provided to fit that format of shapes. Thanks for the quick response, HansV.

        • #1015383

          Simply change

          Dim shp As InlineShape

          to

          Dim shp As Shape

          and

          For Each shp In doc.InlineShapes

          to

          For Each shp In doc.Shapes

          • #1015386

            Perfect, HansV. Thanks alot, works great.

            • #1017316

              I recently figured out that this function returns the inlineshapes in the order they were created in the document and not the order they appear in the document. I just wanted to document this for others. I spent awhile figuring this out, hope to save someone else the time. Thanks again, HansV

    Viewing 0 reply threads
    Reply To: Listing all shape name/values in collection (Word XP)

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

    Your information: