none
C# Code to Open .WMF file in VISIO 2010 RRS feed

  • Question

  • Please can any one suggest a way to  load a .wmf file into an application which is having 'axDrawingControl' of Visio in C#.
    • Moved by Max Meng Friday, August 31, 2012 1:39 AM moving to a more appropriate forum (From:Visio General Questions and Answers for IT Professionals)
    Thursday, August 30, 2012 6:27 AM

Answers

  • Hi Jay_201010,

    Based on your issue, please refer to following C# code block to open a .wmf file by using axDrawingControl

    try
    
    {
    
    axDrawingControl1.Focus();
    
    doc = axDrawingControl1.Document.Application.Documents.OpenEx(@"D:\Drawing1.wmf", (short)VisOpenSaveArgs.visOpenDocked );
    
    }
    
    catch (Exception ex)
    
    {
    
    MessageBox.Show(ex.ToString());
    
    }
    

    Hope it helps.

    Have a good day.


    Leo_Gao [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jay_201010 Monday, September 3, 2012 9:02 AM
    Friday, August 31, 2012 6:18 AM
    Moderator

All replies

  • Hi Jay_201010,

    Based on your issue, please refer to following C# code block to open a .wmf file by using axDrawingControl

    try
    
    {
    
    axDrawingControl1.Focus();
    
    doc = axDrawingControl1.Document.Application.Documents.OpenEx(@"D:\Drawing1.wmf", (short)VisOpenSaveArgs.visOpenDocked );
    
    }
    
    catch (Exception ex)
    
    {
    
    MessageBox.Show(ex.ToString());
    
    }
    

    Hope it helps.

    Have a good day.


    Leo_Gao [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jay_201010 Monday, September 3, 2012 9:02 AM
    Friday, August 31, 2012 6:18 AM
    Moderator
  • Hey Leo_Gao

    That worked !! thanks a lot!

    Monday, September 3, 2012 9:08 AM