Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    251
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hello,

    I have a Visio 2007 flowchart that needs to be resized.

    The flowchart is currently sized to print out as an "E" sized drawing.
    I have been asked to change the font size in all of the boxes from Arial 8pt to Arial 12pt.

    I found a macro on the web that accomplished the font size change and now I would like to change the box size to match the text size.

    Is there a macro that will change the height and width of every box size on the flowchart?


    Perhaps, there is an easier way to go about this task, such as a macro to scale the drawing proportionately....

    Any information on how best to handle this task, is appreciated.

    Regards,

    -J

  2. #2
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    I'm going to move this thread to the VBA forum. You are more likely to be seen by folks who can help you there.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by jamesm067 View Post
    ...
    Perhaps, there is an easier way to go about this task, such as a macro to scale the drawing proportionately....
    ...
    Have you tried simply changing the drawing scale - I don't see why you would need a Macro to do this.

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,534
    Thanks
    3
    Thanked 147 Times in 140 Posts
    I wouldn't use VBA for this - it is unneccessary. You can resize each shape with VBA but the connectors need to stay connected and relative positions will become a problem.

    It is easier to just group the entire drawing and drag it larger. Do this by pressing Ctrl-A then Shift-Ctrl-G. Now drag a corner diagonally to stretch the shapes larger.

    You can change the font sizes now you have all the shapes selected too although I would recommend you do this by using the Define Styles command under the Format menu.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. #5
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    251
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hello all,

    Thanks for the postings. Yes, I was aware of the Select All/Group and resize option and that is probably the best option for me, as I have a flowchart that runs from the
    top to the bottom of a E Size drawing.

    I was curious more than anything about Macros that can be used to resize boxes.


    Here is the Visio macro that resizes text, for anyone interested:

    Regards,

    -J


    http://www.vbaexpress.com/kb/getarticle.php?kb_id=507



    Option Explicit

    Public Sub FontChange()
    ' Change the font of all shapes to 12pt
    Dim shpObjs As Visio.Shapes
    Dim shpObj As Visio.Shape
    Dim celObj As Visio.Cell
    Dim i As Integer

    'Reference to Shapes collection
    Set shpObjs = ActivePage.Shapes

    'Loop Shapes collection to change font size
    For i = 1 To shpObjs.Count
    Set shpObj = shpObjs(i)
    Set celObj = shpObj.Cells("Char.Size")
    celObj.Formula = "=12 pt."
    ' or
    ' shapeObj.Cells("Char.Size[1] ").Formula = "= 12 pt."
    Next

    'Clean up
    Set celObj = Nothing
    Set shpObj = Nothing
    Set shpObjs = Nothing
    End Sub

  6. #6
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,534
    Thanks
    3
    Thanked 147 Times in 140 Posts
    As an academic exercise, the code to resize the shapes and fonts can be written more succinctly. Note that the relative positions won't change so that this is not simply zooming your graphic.
    Code:
    Sub SupersizeMe()
      Dim shpObj As Visio.Shape, dblSize as Double
      dblSize = 1.5   'the magnification factor (>1 gets bigger, <1 gets smaller)
      On Error Resume Next   'some shapes have protected properties so the code would fail
      For Each shpObj In ActivePage.Shapes
        shpObj.Cells("Width") = shpObj.Cells("Width") * dblSize 
        shpObj.Cells("Height") = shpObj.Cells("Height") * dblSize 
        shpObj.Cells("Char.Size") = shpObj.Cells("Char.Size") * dblSize 
      Next shpObj
    End Sub
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  7. #7
    New Lounger
    Join Date
    May 2010
    Location
    Seatte, WA
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Another way to do this is with the Size and Position window that you can open with the View menu. Assuming all of the boxes are the same size, you can multi-select them either with a selection fence or by Shift clicking each individual box to select the ones you want. After your selection is complete, in the Size and Position window enter the new vertical and horizontal sizes you want. Be sure you hit Enter after the last entry while your cursor is in the S&P box, and all of the shapes will change to the new dimensions.

Posting Permissions

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