Visio Guy

Visio Discussions => Programming & Code => Topic started by: bazinga on January 11, 2016, 09:38:37 PM

Title: Is it possible to get entire rows from shapesheet from code ?
Post by: bazinga on January 11, 2016, 09:38:37 PM
I know we can get the row values using CellsU but is it possible to get all the data / rows of shapesheet at once and store in an array?
Title: Re: Is it possible to get entire rows from shapesheet from code ?
Post by: Surrogate on January 12, 2016, 04:36:26 AM
you need get all rows in some section or whole shapesheet's row ?
Title: Re: Is it possible to get entire rows from shapesheet from code ?
Post by: Surrogate on January 12, 2016, 04:49:34 AM
Quote from: David J ParkercelMaker copies Visio custom properties, user-defined cells and actions to and from Excel.
Microsoft Office Visio shape developers often need to copy custom properties, user-defined cells, actions and connection points from one master to another.
celMaker is a developers tool that allows selected ShapeSheetâ„¢ sections to be documented, verified, enhanced and propagated from one Visio master to another, including the migration of complex formulae. Current version supports Custom Properties, User-defined cells, Actions, Connection Points and SmartTags*.

* Visio 2003 only
Feature Print ShapeSheet allow collect whole shapesheet's rows to excel

Quote from: David J Parker
Can I Print Out the ShapeSheet Settings?


The output displays the cell name, value, and formula in each section, in an extremely verbose manner. This makes for many rows in the worksheet, and a varying number of columns in each section.
Title: Re: Is it possible to get entire rows from shapesheet from code ?
Post by: bazinga on January 12, 2016, 11:03:45 AM
@Surrogate, Ideally I'd like to get all the rows with a Prefix for example all rows that have Prop. or all rows that have ABC. or anything I add as prefix.

BUt I think I can work it out if I manage to get all rows along with sections.
Title: Re: Is it possible to get entire rows from shapesheet from code ?
Post by: bazinga on January 12, 2016, 11:04:46 AM
And I need to get this from Code, VB.NET not from Visio GUI.
Title: Re: Is it possible to get entire rows from shapesheet from code ?
Post by: Surrogate on January 12, 2016, 11:28:40 AM
My advice contain two step
1. Get data from GUI, using existing tools
2. Operate with data with your code

But you prefer more expensive way :)
You didn't answer which sections you need get ?
Title: Re: Is it possible to get entire rows from shapesheet from code ?
Post by: Surrogate on January 12, 2016, 12:30:20 PM
Sub bazinga()
Dim s% '
Set sh = ActiveWindow.Selection(1)
s = 244 ' select one ID in sections list
' Enum VisSectionIndices
' http://visualsignals.typepad.co.uk/files/visioenumerations.txt
'0 - visSectionFirst
'1 - visSectionObject
'3 - visSectionCharacter
'4 - visSectionParagraph
'5 - visSectionTab
'6 - visSectionScratch
'7 - visSectionConnectionPts
'8 - visSectionTextField
'9 - visSectionControls
'10 - visSectionFirstComponent
'239 - visSectionLastComponent
'240 - visSectionAction
'241 - visSectionLayer
'242 - visSectionUser
'243 - visSectionProp
'244 - visSectionHyperlink
'245 - visSectionReviewer
'246 - visSectionAnnotation
'247 - visSectionSmartTag
'252 - visSectionLast
'255 - visSectionInval
'255 - visSectionNone
For r = 0 To sh.RowCount(s) - 1
For c = 0 To sh.RowsCellCount(s, r)
Debug.Print sh.CellsSRC(s, r, c).Name, sh.CellsSRC(s, r, c).Formula, sh.CellsSRC(s, r, c).Result("")
Next
Debug.Print "---"
Next
End Sub
Title: Re: Is it possible to get entire rows from shapesheet from code ?
Post by: wapperdude on January 12, 2016, 03:32:17 PM
You may want to check out Paul Herber's Super Utilities.  I know it can copy certain sections from one shape and paste into another.

Wapperdude
Browser ID: smf (is_webkit)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 1: index+Modifications.english (default).
Style sheets: 0: .
Hooks called: 81 (show)
Files included: 25 - 925KB. (show)
Memory used: 796KB.
Tokens: post-login.
Cache hits: 7: 0.00111s for 22,302 bytes (show)
Cache misses: 1: (show)
Queries used: 9.

[Show Queries]