browse by category or date

In Visio 2010, the default connection point is Inward. Despite my recent findings on Visio, I can’t find any method to change the default connection point to In-Out. Facing this kind of situation, we can always rely on Macro to help our cause.

First, let’s enable the Developer Mode. Without this, we can’t add our macro codes. Click File → Options → Advanced, then scroll all the way down.

After we clicked OK, we can press Alt-F11 to open the Visual Basic editor. Double-click ThisDocument to active the source code editor, then paste below code:

Sub ConnectPtsAllInOut()
    'Enable diagram services
    Dim DiagramServices As Integer
    DiagramServices = ActiveDocument.DiagramServicesEnabled
    ActiveDocument.DiagramServicesEnabled = visServiceVersion140

    Dim UndoScopeID1 As Long
    UndoScopeID1 = Application.BeginUndoScope("Inward and Outward")
    Dim vsoRow1 As Visio.Row
    Dim ctr, ctr2 As Integer
    Dim Sections As Object
    'Array starts from 1
    For ctr = 1 To Application.ActiveWindow.Page.Shapes.Count
        'Ensure the Shape has connection points Array
        On Error Resume Next
        Set Sections = Application.ActiveWindow.Page.Shapes(ctr).Section(visSectionConnectionPts)
        If Err.Number = 0 Then
            'Inconsistently, now array starts from 0
            For ctr2 = 0 To Application.ActiveWindow.Page.Shapes(ctr).Section(visSectionConnectionPts).Count - 1
                Set vsoRow1 = Application.ActiveWindow.Page.Shapes(ctr).Section(visSectionConnectionPts).Row(ctr2)
                vsoRow1.Cell(visCnnctType).FormulaU = visCnnctTypeInwardOutward
            Next
        End If
    Next
    
    Application.EndUndoScope UndoScopeID1, True

    'Restore diagram services
    ActiveDocument.DiagramServicesEnabled = DiagramServices
End Sub

I hope it helps. Cheers!

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

This past week I have been busy creating many Data-Flow-Diagram in Microsoft Visio 2010. One major annoyance that I found was I can’t set the curved connectors as the default connector. It was very frustrating to change every individual connectors to a curved one.

Luckily, I accidentally found the solution today! Here’s how:

  1. In your Ribbons, go to Design Tab
  2. Click the Connectors button, select Curved lines

That’s it! Now, everytime you draw a connector, it will be a curved connector. Unfortunately, you need to repeat above steps when you open new/different document.

I hope it helps. Cheers!

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

I was testing this blog’s most popular page’s load-speed in Internet Explorer 9 when I realized that the JavaScript execution was stopped half-way. To found out what went wrong, I quickly pressed F12 key to open Developer Tools then I hit F5 key to reload the page.

Hmm.. interesting. The error says “A security problem occurred“. To dig deeper, I switched to Script tab and clicked “Start Debugging” button. It reloaded the page and shown me where exactly the error triggered.

So I added variable L to watch:

Hmm.. interesting, apparently there is a security blockade that prevented JavaScript accessing the value of href of L object. So I followed the steps to troubleshoot script errors in Internet Explorer:

  1. Method 1: Disable script debugging
  2. Method 2: Test a webpage from another user account, browser, or computer
  3. Method 3: Verify that Active Scripting, ActiveX, and Java are not being blocked by Internet Explorer
  4. Method 4: Remove all temporary Internet files
  5. Method 5: Install the latest service pack and software updates for Internet Explorer
  6. Method 6: Resolve script errors when you try to print from Internet Explorer

But it was a completely useless 🙁

So I opened other pages in my blog and voila, no JavaScript error. It means something special on that page break the JavaScript parser!!!. So I returned to that page and took a closer look.

So I search the HTML source code for R.Heri Rahmayanto and found this:

<a href='http://herirahmayanto@gmail.com' rel='external nofollow' class='url'>R.Heri Rahmayanto, SPd</a>

Yeah that’s right. IT WAS ALL CAUSED BY INVALID URL ADDRESS!!!

So now we know how to totally ruin the JavaScript experience for Internet Explorer users 👿

Note: I’m using Internet Explorer 9 with standard settings.

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant: