CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2008
    Location
    United States
    Posts
    18

    Exclamation VB .NET to open Visio

    I have a question.

    I am creating a VB .NET application that opens Visio to do some stuff there. Visio runs a splash screen on startup and the only way to stop the splash screen from loading is to use code like:

    "C:\Program Files\Microsoft Office\Visio10\Visio.exe" /nologo
    "C:\Program Files\Microsoft Office\Visio11\Visio.exe" /nologo
    "C:\Program Files\Microsoft Office\Visio12\Visio.exe" /nologo

    for each Visio versions in the command line (but I am not using the command line).

    The problem I am having is that I can't run this code from my vb .net application, because my application uses the following code to load Visio:

    Dim vsoApplication As Application
    vsoApplication = New Visio.Application()
    vsoApplication.Visible = False

    and I do not know how to call the "/nologo" feature on loading time from my code to skip the Visio splash screen.

    Any help is highly appreciated.
    "We are what we repeatedly do. Excellence, therefore, is not an act, but a habit.", Aristotle

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: VB .NET to open Visio

    Look up Process.Start()

    It lets you call programs with parameters
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: VB .NET to open Visio

    You could also try the ProcessInfo object as well

  4. #4
    Join Date
    Mar 2008
    Location
    United States
    Posts
    18

    Re: VB .NET to open Visio

    Thank you for your replies.

    Using the ProcessStartInfo functionality helps in hiding Visio's splash screen, but in my code I have a variable called:

    Public vsoApplication As Microsoft.Office.Interop.Visio.Application

    and this variable is used everywhere to enable Visio's functions.

    I am having problems associating the newly started visio process that I started using the ProcessStartInfo functionality with the vsoApplication object, so that I can use it in my code.

    So is there a way to identify the process type and get the application associated with that type and assign it to the vsoApplication variable?

    Can you please help me resolve that?

    Thanks.
    "We are what we repeatedly do. Excellence, therefore, is not an act, but a habit.", Aristotle

  5. #5
    Join Date
    May 2012
    Posts
    1

    Re: VB .NET to open Visio

    You can use the InvisibleApp class.

    Imports Visio = Microsoft.Office.Interop.Visio

    Dim vsoApplication As Visio.InvisibleApp
    instead of
    Dim vsoApplication As Visio.Application

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured