none
Changing Data Graphics Text color properties for shape data RRS feed

  • Question

  • Hello, 

    I have imported one column from excel as external data into Visio

    Once the data is imported, I am linking it to my existing shapes. After linking, the data appears as Shape Data and the excel column is properly connected to it, such that when I update the data in excel, save it, refresh the external data in Visio, the Shape data value is updating.

    I have basically two problems

    1. The Shape data is always under the shape, whereas I want the Shape Data text to appear above the shape, can I change it?

    2. I need to modify the font of the shape data. When I view the Drawing explorer, I can clearly see the Shape, underlying sheets and Heading 2 (which corresponds to the Shape Data layer which is applied). I am trying to update the Heading 2 properties but I cannot select it in visual basic. This is what I am doing:                    

    Sub ChangeColors()
        Dim Color_R As String
        Dim Color_G As String
        Dim Color_B As String
        Dim Color_Combined As String
        Color_R = "(0, "
        Color_G = "255, "
        Color_B = "0)"
        Color_Combined = "RGB" & Color_R & Color_G & Color_B

        Dim intCounter As Integer
        Dim intShapeCount As Integer
        Dim vsoShapes As Visio.Shapes

        Dim CurrentShape As Visio.Shape
        Dim CurrentShapeName As String

        Set vsoShapes = ActiveDocument.Pages.Item(1).Shapes

        intShapeCount = vsoShapes.Count

            For intCounter = 1 To intShapeCount
                CurrentShapeName = vsoShapes.Item(intCounter).Name
                Set CurrentShape = vsoShapes.Item(intCounter)
                Debug.Print " "; CurrentShape
                Debug.Print " "; CurrentShape.LayerCount

                Application.ActiveWindow.Page.Shapes.Item(CurrentShapeName).OpenSheetWindow
                Application.ActiveWindow.Shape.CellsSRC(visSectionCharacter, 0, visCharacterColor).Formula = Color_Combined
                Application.ActiveWindow.Close
            Next intCounter

        Application.ActiveWindow.WindowState = visWSMaximized

    End Sub

    So I am selecting the shapes one by one with the CurrentShapeName, but this is not enough, I need to select the Heading 2 component inside that shape before opening the Sheet Window and then CellsSRC command will change the color. 

    Can someone help me out? Have I explained the problem clearly?

    TIA

    Friday, August 10, 2012 12:12 AM