Link to home
Start Free TrialLog in
Avatar of HyperBPP
HyperBPP

asked on

VB.net formatting of connector types

I'm building a a chart in powerpoint using VB.net.  Here is one function to build a chart:

 Sub addFAChart(FA As String, ByRef rsMO As ADODB.Recordset, coIRPL As IRPL)

        Dim pptSlide As Microsoft.Office.Interop.PowerPoint.Slide
        Dim rsCO As ADODB.Recordset
        Dim oSALayout As SmartArtLayout
        Dim QNode As SmartArtNode
        Dim levelThreeQNode As SmartArtNode
        Dim QNodes As SmartArtNodes
        Dim oShp As Microsoft.Office.Interop.PowerPoint.Shape

        pptSlide = addSlide(PpSlideLayout.ppLayoutText)

        oSALayout = pptPowerPointApp.SmartArtLayouts(105) 'reference to organization chart

        oShp = pptSlide.Shapes.AddSmartArt(oSALayout, 0.42 * 72, 0.33 * 72, 6.75 * 72, 11.0 * 72)


        QNodes = oShp.SmartArt.AllNodes
        For i = 1 To 5      'delete all included nodes
            oShp.SmartArt.AllNodes(1).Delete()
        Next

        oShp.SmartArt.AllNodes(1).TextFrame2.TextRange.Text = FA
        oShp.SmartArt.AllNodes(1).Shapes.Fill.ForeColor.RGB = RGB(185, 205, 229)
        oShp.SmartArt.AllNodes(1).Shapes.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(0, 0, 0)


        Do While Not rsMO.EOF

            QNode = oShp.SmartArt.AllNodes.Add


            QNode.TextFrame2.TextRange.Text = "MO " & rsMO.AbsolutePosition & ": " & rsMO.Fields("title").Value

            QNode.Shapes.Fill.ForeColor.RGB = RGB(166, 166, 166)
            QNode.Shapes.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(0, 0, 0)

            rsCO = coIRPL.getCO("[Major Objective] ='" & rsMO.Fields("Major Objective").Value & "'")

            Do While Not rsCO.EOF

                levelThreeQNode = QNode.AddNode(Microsoft.Office.Core.MsoSmartArtNodePosition.msoSmartArtNodeBelow)

                levelThreeQNode.TextFrame2.TextRange.Text = "CO " & rsCO.AbsolutePosition & ": " & rsCO.Fields("title").Value

                levelThreeQNode.Shapes.Fill.ForeColor.RGB = RGB(162, 192, 162)

                levelThreeQNode.Shapes.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(0, 0, 0)


                levelThreeQNode = Nothing

                rsCO.MoveNext()
            Loop

            rsCO = Nothing

            rsMO.MoveNext()
        Loop

       

    End Sub

Open in new window


The connector types in the smart art come out as diagonal lines... i'd like them to be elbow connectors.  How do I format the connectors in the smartart?  I'd also like to change the color but just can't figure out the namespace/class/method path.
Avatar of plusone3055
plusone3055
Flag of United States of America image

here is a youtube video for working in smartart to format lines and colors.
its for the office side but works just the same in powerpoint smartart

http://www.youtube.com/watch?v=ulHbVDe_5RA
Avatar of John Wilson
I am pretty sure there is no way to make the "connectors" elbow connectors.
Avatar of HyperBPP
HyperBPP

ASKER

Well, maybe elbow is the wrong word... But I want them to have those 90 degree angles rather than be diagnol.  The first post is a video for doing it manually.  I need to do it via code.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of John Wilson
John Wilson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial