Try: VsApp.ActiveWindow.Page = vsPage If that doesn't work, try: VsApp.ActiveWindow.Page = VsApp.Documents.Open(FName).Pages(vsPage) ...
You could start with something like this... it's pretty straightforward I suppose.. ....... ....... page = visapp.ActivePage for shape in page.Shapes: if not shape.OneD: print shape.Name + " '" + shape.Text + "'" for connectedShapeId in shape.ConnectedShapes(2, ""): connectedShape = page.Shapes.ItemFromID[connectedShapeId] print " => " + connectedShape.Name + " '"...
You have a couple options here: Force every user to allow programmatic access to the VBA project for their documents, and use VBA automation to add code. This works nicely when you have programmatic access, but this can be difficult to assure. If you're not using Visio 2013, you can...
CreateSelection can also be used on a group shape to get sub-shapes, but I do not think that you can create a selection of all page shapes and group sub-shapes in a single line. You would need to build up the selection from many CreateSelection calls (one at page, and...
Visio doesn't have a Run method on the Application object, but it does have Document.ExecuteLine: 'Executes the macro (procedure without an argument) named "SomeMacro" 'that is in some module of the Visual Basic project of ThisDocument. ThisDocument.ExecuteLine("SomeMacro") 'Executes the procedure named SomeProcedure and passes it 3 arguments. ThisDocument.ExecuteLine("SomeProcedure 1, 2,...
The error is because you have declared the vsoPage but you never assigned it to any page in your document. Add a line such as this to initialize it and the error goes away: Set vsoPage = ActivePage ...
You can use "shape data sets" Open shape-data window. Right-click, select "Shape data sets" => new window "shape data sets" will be opened. Select source shape, in the "shape data sets" click "Add set", name it somehow (e.g. "my dataset"). Set checkbox on "my dataset", select target shapes, click "apply...
I was able a similar effect by locking all layers before adding my shape. For my needs, I left them locked, until the shapes were not needed anymore and I removed them, and then unlock the layers: foreach (Visio.Layer layer in Application.ActivePage.Layers) { layer.CellsC[(short)Visio.VisCellIndices.visLayerLock].Formula = "1"; } // Add my...
sql-server,views,reverse-engineering,visio
You are probably using "wrong" data provider to reverse engineer the database, and that is the reason why views are disabled. There are some issues with Visio not being updated to support newer SQL server versions. Try the following: Start "reverse engineer" wizard Select Generic OleDb data provider (not the...
You could try something like the following: //drop a connector onto the page, then connect them public void dropStaticConnector( Shape sFrom, String connectionPointName1, Shape sTo, String connectionPointName2) { // drop a default connector var conn = ActivePage.Drop(Application.ConnectorToolDataObject, 0, 0); // glue it to the connection points conn.Cells("BeginX").GlueTo(sFrom.Cells("Connections." + connectionPointName1)); conn.Cells("EndX").GlueTo(sTo.Cells("Connections."...
You don't need to create a ChefsInRestaurant table.Add a foreign key attribute to chief table(FK_rest_Name). In your example ıt shows one chief can work for more than one rest.
Yes, it is possible to query visio shape information (shape types, text, connections, etc) programmatically. Visio provides COM API which you can use form any language which can call COM API, python for example (using e.g. either .NET module (clr) or win32com module). Here is a similar question: Reading the...
powershell,office-interop,visio,powershell-v4.0,visio2013
You can try this: $visio = New-Object -ComObject Visio.InvisibleApp $visio.Quit() Note that it's not a must to use Add-Type (however you can go also with Add-Type, in this case try Microsoft.Office.Interop.Visio.InvisibleAppClass BTW, there is a library for using Visio from PS: https://visioautomation.codeplex.com/...
First option is already voiced by @Jon Fournier. DocumentSheet is a Visio way to store document-specific values. Check out also this article, which gives more details: http://visualsignals.typepad.co.uk/vislog/2011/11/shapes-with-global-values.html The second option could be Document.SolutionXmlElement, which allows you to store arbitrary XML fragment in Visio file for a document. https://msdn.microsoft.com/en-us/library/office/aa218416.aspx Third option...
According to this video (the introduction with the use case is quite disappointing), the representation of sub-activities with Visio seems less integrated with the tool than in Visual Studio, but possible anyway. It worked with Visio 2007. Should work with Visio 2013......
shape,visio,shapes,stencils,shapesheet
Answer of 1st Question: This problem always is for don't attend to the "Category" word. In most cases, people don't attend to that word and use the "Shape Master Name" instead of "Shape Category"; however, they're different with each other. In my case, I was being entered the Shape Master...
sql-server,database-connection,visio
Reverse Engineering option was removed from Visio 2013. Use previous version of Visio to reverse-engineer a database.
sql,attributes,entity,entity-relationship,visio
The way I learned ERDs you have your 'Comments' entity with the attributes. When listing the attributes you can also include metadata about them - datatype, allows nulls, etc. I think you can list 'allows nulls' beside the attributes. However, if 'Email' is your primary key, you can't have a...
You should use ExportAsFixedFormat instead SaveAs. Documentation for this function you can find here. This function can be used with a win32 and a comtypes. win32com example import win32com.client visio = win32com.client.Dispatch("Visio.Application") doc = visio.Documents.Open('map.vsd') doc.ExportAsFixedFormat( 1, 'map.pdf', 1, 0 ) comtypes example import comtypes.client as coms visio = coms.CreateObject('Visio.Application')...
As you drag/drop or copy a shape from an existing document into a new document Visio will also copy across any associated styles at the same time. The same goes for masters - copy a master from one stencil to another and you'll bring the style with you. If you...
shape,visio,shapes,stencils,shapesheet
This feature is called "List" (structured diagram) in Visio (was introduced in Visio 2010). To allow this sort of functionality (allow some shape to "accept" others similarly to "class" shape), you need to declare the shape to be a "list", by setting the user property User.msvStructureType="List" in it's shape sheet....
vba,visio,shapesheet,visio-2010
Thanks for helping all. A combination of all advice led me to an alternative solution. Instead of trying to refer to the field in the Shapesheet that does contain the BeginItemValue, I built the entire string (in VBA) by concatenating the parts and then updated the BeginX value with it....
You'll have to change the way you're opening and printing Visio documents. This tutorial shows how to use VB.NET to work with documents. The Open function returns an object of type Microsoft.Office.Interop.Visio.Document. You can use this object to attach information to shapes as discussed in here. In fact, the VB.NET...
I was successful in obtaining the formula by: string fontSize = shape.CellsSRC[(short) Visio.VisSectionIndices.visSectionCharacter, (short) Visio.VisRowIndices.visRowCharacter, (short) Visio.VisCellIndices.visCharacterSize].Formula; Or by: string fontSize = shape.CellsSRC[3,0,7].Formula; Which is practically the same, only not very readable, Or by: string fontSize = shape.get_Cells("Char.Size").Formula; ...
The Visio Shapesheet EventDrop cell lets you specify code to call when the shape is dropped on the page. It also works when duplicating the shape. If it's a VBA macro then you can use CALLTHIS or RUNMACRO. CALLTHIS requires that the first argument in your VBA macro is a...
The sample code at: https://msdn.microsoft.com/en-us/library/ff767482(v=office.15).aspx shows how to set up event monitoring using Visio's AddAdvise method, and get a categorization of what type of MouseMove event is occurring. Using this method and logging /drop events, it seems that Visio is passing the same event multiple times under the low-memory conditions,...
The shape is designed to prevent easily changing this property, so you need to brute-force your way through this. Open up the master's shapesheet and change the LineFormat/EndArrow cell formula to 0 (or GUARD(0) if you prefer).
VSTO is for a different thing (it's for creating Visio addins), it is, well, unrelated to what you are after. There are two Visio controls you can use in your C# application: Visio Viewer control (allows you to view Visio drawing in a C# application), and Visio Drawing control (allows...
vba,visio,visio-vba,visio-2010
I'm not completely clear on your issue, but there's nothing special about connectors - they're still just shapes. So if you know the index of your target shape and layer, then you can use your code above. Shapes in Visio can also belong to multiple layers (layers don't work in...