Consulting

Results 1 to 4 of 4

Thread: Fixing a connector in PowerPoint VBA

  1. #1

    Fixing a connector in PowerPoint VBA

    Hello all,


    I am trying to eliminate jogs of connector that has occurred in slides. I tried following approach but this is not helping in anyway. Please help


    Problem illustration:


    If the rectangles are moved, then the connectors attached to that is effected. The connector ( arrow head elbow connector) has a bend or is inclined, I am trying to fix this so that process chart looks neat and oriented. I would like to know the functionality/method to decrease the size/shrink the connector and run macros without any manual 'selection' of shapes/objects. The macro itself should identify the place where connectors are disoriented and fix them. something like this, the connector that is pointed with red arrow is the connector to be fixed and blue arrow is expected result.




    Code I tried: To do this for all connector you can just loop all the connectors and check or adjust the Y positions. Which should move the left end to the same as the right end


    Sub SetConnectors()
    Dim osld As Slide, oshp As Shape
    For Each osld In ActivePresentation.Slides
    For Each oshp In osld.Shapes
    If oshp.Type = msoConnectorStraight Then
    oshp.BeginY = oshp.EndY


    End If
    Next oshp
    Next osld
    End Sub
    Attached Images Attached Images

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    This is a long standing bug with elbow connectors. Do you need elbows?

    If you select the connector and check SIZE you will see the height is not exactly zero. Set it to zero can help (temporarily) but might also disconnect it. If you try to do this in code the test you are using will not work. Connector (and all shapes) are Type 1. You would need to further check the oshp.Autoshape.Type for -2 which is still all lines. A possible test is to check the NAME

    If oshp.Name Like "*Connector*" Then but this will of course fail if the name is changed.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    Yes, I need elbow connectors. Is there no way to solve this bug?

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    I don't know any permanent way. Setting Height to zero can help but it doesn't "stick"
    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
  •