Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 291805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:07:20+00:00 2026-05-12T06:07:20+00:00

At work we make pretty extensive use of Visio drawing as support for documentation.

  • 0

At work we make pretty extensive use of Visio drawing as support for documentation. Unfortunately vsd files don’t play nicely with our wiki or documentation extraction tools like javadoc, doxygen or naturaldocs. While it is possible to convert Visio files to images manually, it’s just a hassle to keep the image current and the image files are bound to get out of date. And let’s face it: Having generated files in revision control feels so wrong.

So I’m looking for a command line tool that can convert a vsd file to jpeg, png, gif or any image that can be converted to an image that a browser can display. Preferably it will run under unix, but windows only is also fine. I can handle the rest of the automation chain, cron job, image to image conversion and ssh, scp, multiple files, etc.

And that’s why I’m turning to you: I can’t find such a tool. I don’t think I can even pay for such a tool. Is my Google-fu completely off? Can you help me?

I mean, it has got to be possible. There has to be a way to hook into Visio with COM and get it to save as image. I’m using Visio 2007 by the way.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:07:20+00:00Added an answer on May 12, 2026 at 6:07 am

    I slapped something together quickly using VB6, and you can download it at:
    http://fournier.jonathan.googlepages.com/Vis2Img.exe

    You just pass in the input visio file path, then the output file path (visio exports based on file extension) and optionally the page number to export.

    Also here is the source code I used, if you want to mess with it or turn it into a VBScript or something, it should work, though you’d need to finish converting it to late-bound code.

    hope that helps,

    Jon

    Dim TheCmd As String
    Const visOpenRO = 2
    Const visOpenMinimized = 16
    Const visOpenHidden = 64
    Const visOpenMacrosDisabled = 128
    Const visOpenNoWorkspace = 256
    
    Sub Main()
        ' interpret command line arguments - separated by spaces outside of double quotes
        TheCmd = Command
        Dim TheCmds() As String
        If SplitCommandArg(TheCmds) Then
            If UBound(TheCmds) > 1 Then
                Dim PageNum As Long
                If UBound(TheCmds) >= 3 Then
                    PageNum = Val(TheCmds(3))
                Else
                    PageNum = 1
                End If
    
                ' if the input or output file doesn't contain a file path, then assume the same
                If InStr(1, TheCmds(1), "\") = 0 Then
                    TheCmds(1) = App.Path & "\" & TheCmds(1)
                End If
                If InStr(1, TheCmds(2), "\") = 0 Then
                    TheCmds(2) = App.Path & "\" & TheCmds(2)
                End If
    
                ConvertVisToImg TheCmds(1), TheCmds(2), PageNum
            Else
                ' no good - need an in and out file
            End If
        End If
    
    End Sub
    
    Function ConvertVisToImg(ByVal InVisPath As String, ByVal OutImgPath As String, PageNum As Long) As Boolean
        ConvertVisToImg = True
        On Error GoTo PROC_ERR
    
        ' create a new visio instance
        Dim VisApp As Visio.Application
        Set VisApp = CreateObject("Visio.Application")
    
        ' open invispath
        Dim ConvDoc As Visio.Document
        Set ConvDoc = VisApp.Documents.OpenEx(InVisPath, visOpenRO + visOpenMinimized + visOpenHidden + visOpenMacrosDisabled + visOpenNoWorkspace)
    
        ' export to outimgpath
        If Not ConvDoc.Pages(PageNum) Is Nothing Then
            ConvDoc.Pages(PageNum).Export OutImgPath
        Else
            MsgBox "Invalid export page"
            ConvertVisToImg = False
            GoTo PROC_END
        End If
    
        ' close it off
    PROC_END:
        On Error Resume Next
        VisApp.Quit
        Set VisApp = Nothing
        Exit Function
    PROC_ERR:
        MsgBox Err.Description & vbCr & "Num:" & Err.Number
        GoTo PROC_END
    End Function
    
    Function SplitCommandArg(ByRef Commands() As String) As Boolean
        SplitCommandArg = True
        'read through command and break it into an array delimited by space characters only when we're not inside double quotes
        Dim InDblQts As Boolean
        Dim CmdToSplit As String
        CmdToSplit = TheCmd 'for debugging command line parser
        'CmdToSplit = Command
        Dim CharIdx As Integer
        ReDim Commands(1 To 1)
        For CharIdx = 1 To Len(CmdToSplit)
            Dim CurrChar As String
            CurrChar = Mid(CmdToSplit, CharIdx, 1)
            If CurrChar = " " And Not InDblQts Then
                'add another element to the commands array if InDblQts is false
                If Commands(UBound(Commands)) <> "" Then ReDim Preserve Commands(LBound(Commands) To UBound(Commands) + 1)
            ElseIf CurrChar = Chr(34) Then
                'set InDblQts = true
                If Not InDblQts Then InDblQts = True Else InDblQts = False
            Else
                Commands(UBound(Commands)) = Commands(UBound(Commands)) & CurrChar
            End If
        Next CharIdx
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to make use of $_SERVER , but it didn't work for me.
I stumbled upon a problem of how to make work together acts_as_taggable (on steroids)
What do you think - which functions should be implemented to make work with
There is a weird code here that I need to make work.. can you
How can I make this work? switch(property.PropertyType){ case typeof(Boolean): //doStuff break; case typeof(String): //doOtherStuff
How can I make it work in a network? It works then it stops
I want to make ^N work the same as Down arrow in a tree
Is there any way to make this work in Java? public static void change(List<?
I found all the code I need to make SHBrowseForFolder work in my application.
Does anybody know if there is a way to make autocompletion work in MySQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.