Results 1 to 3 of 3

Thread: Visio Drawing Control, Stencils

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2008
    Posts
    6

    Visio Drawing Control, Stencils

    The below code works fine except that the stencils are editable and every time I close the form I get the message, "would you like to save stencil 1". Open and close the form again it says "would you like to save stencil 2" and so on.
    Code:
    Private Sub AutoAddMenus()
    
        'DrawingControl0.vsoapp.StencilPaths = DrawingControl0.vsoapp.StencilPaths & ";" & Stencil_Path
        
        Dim vsoWin As Visio.Window
        Set vsoWin = DrawingControl0.Window
        
        Dim vsoWins As Visio.Windows
        Set vsoWins = DrawingControl0.Window.Application.Windows
        
        Dim vsoDoc As Visio.Document
        Set vsoDoc = DrawingControl0.Document
        
        Dim vsoDocs As Visio.Documents
        Set vsoDocs = DrawingControl0.Window.Application.Documents
        
        Dim vsoApp As Visio.Application
        Set vsoApp = DrawingControl0.Window.Application
        
        Dim vsoStencilWindow As Visio.Window
        
        Dim vsoTVAstencil As Visio.Document
      
        Dim Path As String
        Dim Stencil1_Name As String
        Dim Stencil_Path As String
        Path = CurrentProject.Path()
        Stencil1_Name = "TVA Cyber Network.vss"
        Stencil_Path = Path & "\Visio Stencils\" & Stencil1_Name
        
        'add the standard TVA stencil to documents collection
        'Set vsoStencilWindow = vsoApp.Window
        'vsoStencilWindow.AllowEditing = False
        'Set vsoStencilWindow = vsoTVAstencil.OpenStencilWindow
        Set vsoTVAstencil = vsoDocs.Add(Stencil_Path)
        vsoTVAstencil.Title = "TVA Standard"
     
        'Open the Document Stencil window.
        'Set vsoStencilWindow = vsoWins.Add()
        'vsoStencilWindow.AllowEditing = False
     
    End Sub
    Last edited by Hack; Dec 23rd, 2008 at 07:51 AM. Reason: Added Code Tags

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Visio Drawing Control, Stencils

    I've never done anything with Visio, but if this were happening to me in Word or Excel, I would set DisplayAlerts = False

    Does Visio have an equivalent to that?

    (BTW: I edited your post and added [code]your code goes here[/code] tags as it makes reading posted code a lot easier. )

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2008
    Posts
    6

    Re: Visio Drawing Control, Stencils

    Not exactly, but similar. The code currently opens the stencils to a docked window. I do this simply by added the stencils "document" object to the docs list. I think I can use a property called allowediting=false, but this property only applies to "window" objects, not "document" objects. So how do I define the window for the docked stencils?

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