Consulting

Results 1 to 13 of 13

Thread: Freeform poly and nodes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Expert TrippyTom's Avatar
    Joined
    Jul 2005
    Location
    New York, NY (USA)
    Posts
    556
    Location

    Freeform poly and nodes

    Is there a way (in vba) to add nodes to a shape after it's created? Or do I have to add them in sequence as I'm creating the shape?

    My situation:
    I want to add 3 nodes to a simple rectangle to allow for multiple connector lines to snap to the shape. PowerPoint won't let me edit points on a rectangle, so what I did was convert it to a freeform poly in the same size so I could add nodes to it.

    But then I ran into this problem. How do I add nodes after-the-fact?
    Office 2010, Windows 7
    goal: to learn the most efficient way

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    You should be able to add nodes using insert nodes method

    example from vb help


    With myDocument.Shapes(3).Nodes
        .Insert 4, msoSegmentCurve, msoEditingSmooth, 210, 100
    End With
    Last edited by Aussiebear; 04-28-2023 at 02:36 AM. Reason: Adjusted the code tags
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Expert TrippyTom's Avatar
    Joined
    Jul 2005
    Location
    New York, NY (USA)
    Posts
    556
    Location
    Hi John,

    Yeah, i saw that in the help files too, but my problem was figuring out the correct formula to get it to work with user-input values. I will post my solution when I get time to sterilize the macro form company info.

    Thanks for the help.
    Office 2010, Windows 7
    goal: to learn the most efficient way

  4. #4
    VBAX Expert TrippyTom's Avatar
    Joined
    Jul 2005
    Location
    New York, NY (USA)
    Posts
    556
    Location
    Ok, here's the macro I came up with. Hope this helps someone out there.
    Office 2010, Windows 7
    goal: to learn the most efficient way

  5. #5
    VBAX Expert TrippyTom's Avatar
    Joined
    Jul 2005
    Location
    New York, NY (USA)
    Posts
    556
    Location
    Why I made this macro:
    I needed a better way to create more advanced Org Charts instead of using the "Insert Diagram" feature in PowerPoint. Unfortunately, autoshape rectangles won't allow you to right click and "edit points" for some crazy reason. You have to use a free-form polygon instead.

    How it works:
    This macro converts a regular rectangle into a freeform poly, then adds the specified number of nodes on the specified edges and distributes them evenly. This helps me save time by not having to create "helper objects" behind other rectangles to connect lines to.
    Office 2010, Windows 7
    goal: to learn the most efficient way

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Nice macro!

    Did you consider adding a text box (based on the size and position of the freeform) and then group it?
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  7. #7
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    If I ever get time I'll take a look again and see if I can add to it. I guess a lot of people reading won't realise how useful this would be in creating custom org charts so I'll take this opportunity to mention it!!
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

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