<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Edit Visio Masters Programmatically&#8230;the Right Way!</title>
	<atom:link href="http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/</link>
	<description>Shapes, Stencils, Drawings Templates, Tutorials, Tips &#38; Developer Info for Microsoft Visio</description>
	<lastBuildDate>Fri, 10 Feb 2012 17:20:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Visio Guy</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-32349</link>
		<dc:creator>Visio Guy</dc:creator>
		<pubDate>Sat, 14 Jan 2012 08:15:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-32349</guid>
		<description>Hi gnash,

Shapes have a shp.ContainingPage, shp.ContainingMaster or shp.ContainingShape (sub-shapes of groups). I would have preferred .ContainingPage to work for both pages and masters, but oh well.

But you don&#039;t have to go that far. Once you have a master, you can get it&#039;s PageSheet, ie: mstCopy.PageSheet. This is a ShapeSheet, essentially the same as a page, but with slight variation in cell names.

If you want to hide text on a shape, you don&#039;t want the &quot;master wrapper&quot;, you really want the shape. So you should do something like this:

If mstCopy.Shapes.Count &gt; 0 Then

  Dim shp As Visio.Shape
  Set shp = mstCopy.Shapes(1)

  &#039;// You don&#039;t need the extra step of the cell object
  &#039;// but it makes the following code easier to read:
  Dim c as Visio.Cell
  set c = shp.CellsSRC(visSectionObject, visRowMisc, visHideText)

  // Several ways to set a cell&#039;s value or formula:
  c.ResultIU = 1 &#039;// 0 = false, 1 = true in the ShapeSheet
  c.Formula = &quot;TRUE&quot;

End If


In your code you were doing:

shp.CellsSRC(visSectionObject, visRowMisc, visHideText) = true

but you should do something more like:

shp.CellsSRC(visSectionObject, visRowMisc, visHideText).ResultIU = 1

as the code snippet above shows.</description>
		<content:encoded><![CDATA[<p>Hi gnash,</p>
<p>Shapes have a shp.ContainingPage, shp.ContainingMaster or shp.ContainingShape (sub-shapes of groups). I would have preferred .ContainingPage to work for both pages and masters, but oh well.</p>
<p>But you don&#8217;t have to go that far. Once you have a master, you can get it&#8217;s PageSheet, ie: mstCopy.PageSheet. This is a ShapeSheet, essentially the same as a page, but with slight variation in cell names.</p>
<p>If you want to hide text on a shape, you don&#8217;t want the &#8220;master wrapper&#8221;, you really want the shape. So you should do something like this:</p>
<p>If mstCopy.Shapes.Count > 0 Then</p>
<p>  Dim shp As Visio.Shape<br />
  Set shp = mstCopy.Shapes(1)</p>
<p>  &#8216;// You don&#8217;t need the extra step of the cell object<br />
  &#8216;// but it makes the following code easier to read:<br />
  Dim c as Visio.Cell<br />
  set c = shp.CellsSRC(visSectionObject, visRowMisc, visHideText)</p>
<p>  // Several ways to set a cell&#8217;s value or formula:<br />
  c.ResultIU = 1 &#8216;// 0 = false, 1 = true in the ShapeSheet<br />
  c.Formula = &#8220;TRUE&#8221;</p>
<p>End If</p>
<p>In your code you were doing:</p>
<p>shp.CellsSRC(visSectionObject, visRowMisc, visHideText) = true</p>
<p>but you should do something more like:</p>
<p>shp.CellsSRC(visSectionObject, visRowMisc, visHideText).ResultIU = 1</p>
<p>as the code snippet above shows.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gnash</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-32320</link>
		<dc:creator>gnash</dc:creator>
		<pubDate>Fri, 13 Jan 2012 19:40:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-32320</guid>
		<description>My question related to this function is about the assignment when the shape is grouped:
Set shp = mstCopy.Shapes(1)

This seems to point to the first the first shape in the grouped shape and not the containing &quot;wrapper&quot; shape.

My goal is to perform the following on a master shape in the stencil using the code in this article:

shp.CellsSRC(visSectionObject, visRowMisc, visHideText) = True

If I run this code against a shape object on the layout page created from a master, it is executed against a parent shape object that may or may not contain additional shapes ~ shape.shapes.count &gt; 1 = true ~ the shape is grouped...

So inspecting the master of the shape I see the same internals, namely shape.shapes.count &gt; 1 = true.  The assumption with the above is that the first shape is assumed to point to the container shape or a grouped object? I would expect based on the shape object model something like this to be the suggested approach.

Set shp = mstCopy.Shapes(1).RootShape

For a grouped shape on the layout page RootShape points to the desired containing shape, however for a master shape RootShape = nothing.

What is the suggested approach to reference the RootShape of a master shape?</description>
		<content:encoded><![CDATA[<p>My question related to this function is about the assignment when the shape is grouped:<br />
Set shp = mstCopy.Shapes(1)</p>
<p>This seems to point to the first the first shape in the grouped shape and not the containing &#8220;wrapper&#8221; shape.</p>
<p>My goal is to perform the following on a master shape in the stencil using the code in this article:</p>
<p>shp.CellsSRC(visSectionObject, visRowMisc, visHideText) = True</p>
<p>If I run this code against a shape object on the layout page created from a master, it is executed against a parent shape object that may or may not contain additional shapes ~ shape.shapes.count &gt; 1 = true ~ the shape is grouped&#8230;</p>
<p>So inspecting the master of the shape I see the same internals, namely shape.shapes.count &gt; 1 = true.  The assumption with the above is that the first shape is assumed to point to the container shape or a grouped object? I would expect based on the shape object model something like this to be the suggested approach.</p>
<p>Set shp = mstCopy.Shapes(1).RootShape</p>
<p>For a grouped shape on the layout page RootShape points to the desired containing shape, however for a master shape RootShape = nothing.</p>
<p>What is the suggested approach to reference the RootShape of a master shape?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yousuf</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-24696</link>
		<dc:creator>Yousuf</dc:creator>
		<pubDate>Mon, 06 Sep 2010 11:48:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-24696</guid>
		<description>My question specially for Visio Guy (Chris Roth): how can you find the commands for Visio Add ons like OrgC11? 
you mentioned:
Call Visio.Application.Addons(“OrgC11?).Run(“/toolbar_horiz1?)
Call Visio.Application.Addons(“OrgC11?).Run(“/toolbar_sidebyside2?)
How can we find information about other commands? Using Macro recoderder is no help!

Many thanks,
Yousuf.</description>
		<content:encoded><![CDATA[<p>My question specially for Visio Guy (Chris Roth): how can you find the commands for Visio Add ons like OrgC11?<br />
you mentioned:<br />
Call Visio.Application.Addons(“OrgC11?).Run(“/toolbar_horiz1?)<br />
Call Visio.Application.Addons(“OrgC11?).Run(“/toolbar_sidebyside2?)<br />
How can we find information about other commands? Using Macro recoderder is no help!</p>
<p>Many thanks,<br />
Yousuf.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Visio Guy</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-23362</link>
		<dc:creator>Visio Guy</dc:creator>
		<pubDate>Fri, 25 Sep 2009 06:30:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-23362</guid>
		<description>Hi aannuu,

That&#039;s a pretty small question that requires a really big answer!

You might try posting your question on our &lt;a href=&quot;http://www.visguy.com/vgforum&quot; rel=&quot;nofollow&quot;&gt;Visio Guy Forum&lt;/a&gt; and try to be a bit more specific as to what you need to do, and what you don&#039;t understand.</description>
		<content:encoded><![CDATA[<p>Hi aannuu,</p>
<p>That&#8217;s a pretty small question that requires a really big answer!</p>
<p>You might try posting your question on our <a  href="http://www.visguy.com/vgforum" rel="nofollow">Visio Guy Forum</a> and try to be a bit more specific as to what you need to do, and what you don&#8217;t understand.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aannuu</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-23357</link>
		<dc:creator>aannuu</dc:creator>
		<pubDate>Thu, 24 Sep 2009 11:40:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-23357</guid>
		<description>hi 

I just want to create a visio application using .net with a textbox and a image insertion. Please anyone can help me.</description>
		<content:encoded><![CDATA[<p>hi </p>
<p>I just want to create a visio application using .net with a textbox and a image insertion. Please anyone can help me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Visio Guy</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-22492</link>
		<dc:creator>Visio Guy</dc:creator>
		<pubDate>Fri, 05 Jun 2009 13:50:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-22492</guid>
		<description>Hi Robert,

1. Right click a master
2. Choose Edit Master &gt; Master Properties...
3. Un-check: Generate icon automatically from shape data</description>
		<content:encoded><![CDATA[<p>Hi Robert,</p>
<p>1. Right click a master<br />
2. Choose Edit Master > Master Properties&#8230;<br />
3. Un-check: Generate icon automatically from shape data</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-22491</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Fri, 05 Jun 2009 13:40:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-22491</guid>
		<description>Hi Visio Guy,
  This is a great macro concept but there is one little bit still missing and I cant seem to figure it out. I have custom built shapes with some basic stencil icons. Well when I change the Masters at the shapesheet level, manually or programicly, my icon is reduced to a garbled mess. 
  How do I keep my icon from changing?</description>
		<content:encoded><![CDATA[<p>Hi Visio Guy,<br />
  This is a great macro concept but there is one little bit still missing and I cant seem to figure it out. I have custom built shapes with some basic stencil icons. Well when I change the Masters at the shapesheet level, manually or programicly, my icon is reduced to a garbled mess.<br />
  How do I keep my icon from changing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flow3rgirlz</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-21560</link>
		<dc:creator>flow3rgirlz</dc:creator>
		<pubDate>Thu, 18 Dec 2008 06:49:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-21560</guid>
		<description>Hi Visio Guy,

I would like to program it automatically using vba.</description>
		<content:encoded><![CDATA[<p>Hi Visio Guy,</p>
<p>I would like to program it automatically using vba.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Visio Guy</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-21559</link>
		<dc:creator>Visio Guy</dc:creator>
		<pubDate>Thu, 18 Dec 2008 06:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-21559</guid>
		<description>Hi F3G,

This article is about programmatically editing masters.

To manually create a master, you just drag from the drawing to a stencil. It&#039;s best to group whatever you draw first into a single shape first (Shape &gt; Grouping &gt; Group or Ctrl + G)

You can create a new stencil in which to create the master via: 

  File &gt; Shapes &gt; New Stencil

Or you can put the master in the &quot;local&quot; stencil of a document:

  File &gt; Shapes &gt; Show Document Stencil

Stencils that open with Visio templates (as purchased from Microsoft) are non-editable. Stencils that you create open read-only when opened with a template. But you can click on the icon in the top-left corner of the stencil and choose &quot;Edit Stencil&quot; to make it writable.</description>
		<content:encoded><![CDATA[<p>Hi F3G,</p>
<p>This article is about programmatically editing masters.</p>
<p>To manually create a master, you just drag from the drawing to a stencil. It&#8217;s best to group whatever you draw first into a single shape first (Shape > Grouping > Group or Ctrl + G)</p>
<p>You can create a new stencil in which to create the master via: </p>
<p>  File > Shapes > New Stencil</p>
<p>Or you can put the master in the &#8220;local&#8221; stencil of a document:</p>
<p>  File > Shapes > Show Document Stencil</p>
<p>Stencils that open with Visio templates (as purchased from Microsoft) are non-editable. Stencils that you create open read-only when opened with a template. But you can click on the icon in the top-left corner of the stencil and choose &#8220;Edit Stencil&#8221; to make it writable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flow3rgirlz</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-21558</link>
		<dc:creator>flow3rgirlz</dc:creator>
		<pubDate>Thu, 18 Dec 2008 02:07:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-21558</guid>
		<description>Hi,

I draw a picture in visio. I would like to save the picture as master in stencil. Is there a way to create a new stencil and add the picture as master in it?  I tried to google it and still couldnt find any way to do it. I also try to make a dummy stencil and try to edit it as what u shown above. But it still doesn&#039;t work. Can anyone please help me out. I&#039;m sort of stuck in here. 

Thanks in advance...</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I draw a picture in visio. I would like to save the picture as master in stencil. Is there a way to create a new stencil and add the picture as master in it?  I tried to google it and still couldnt find any way to do it. I also try to make a dummy stencil and try to edit it as what u shown above. But it still doesn&#8217;t work. Can anyone please help me out. I&#8217;m sort of stuck in here. </p>
<p>Thanks in advance&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Visio Guy</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-21544</link>
		<dc:creator>Visio Guy</dc:creator>
		<pubDate>Fri, 05 Dec 2008 09:44:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-21544</guid>
		<description>Hi F3,

Try this article: &lt;a href=&quot;http://visualsignals.typepad.co.uk/vislog/2007/10/just-for-starte.html&quot; rel=&quot;nofollow&quot;&gt;Just For Starters&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Hi F3,</p>
<p>Try this article: <a  href="http://visualsignals.typepad.co.uk/vislog/2007/10/just-for-starte.html" rel="nofollow">Just For Starters</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flow3rgirlz</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-21543</link>
		<dc:creator>flow3rgirlz</dc:creator>
		<pubDate>Fri, 05 Dec 2008 07:07:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-21543</guid>
		<description>Hi,

i&#039;m new with vba and macro. I tried to run your code but it requires me the insert macro. Can u please explain to me how to run the code. Thanks.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>i&#8217;m new with vba and macro. I tried to run your code but it requires me the insert macro. Can u please explain to me how to run the code. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abdul Ghani</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-21404</link>
		<dc:creator>Abdul Ghani</dc:creator>
		<pubDate>Sat, 25 Oct 2008 01:10:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-21404</guid>
		<description>Hi Visio Guyz,

I am working on a project where in I need to save the properties of master in to SQL DataBase, is there any way to accomplish this. I have done allot of googling for but did&#039;nt any useful article hope you can help me.

Its Urgent.. 
Please reply</description>
		<content:encoded><![CDATA[<p>Hi Visio Guyz,</p>
<p>I am working on a project where in I need to save the properties of master in to SQL DataBase, is there any way to accomplish this. I have done allot of googling for but did&#8217;nt any useful article hope you can help me.</p>
<p>Its Urgent..<br />
Please reply</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Visio Guy</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-21046</link>
		<dc:creator>Visio Guy</dc:creator>
		<pubDate>Sun, 10 Aug 2008 21:31:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-21046</guid>
		<description>Hi Anna,

The Visio.Application object has an add-ons collection. You can start there...

Also, for general questions, not related to the Visio Guy article, please try our forum: http://www.visguy.com/vgforum

Cheers,

Chris</description>
		<content:encoded><![CDATA[<p>Hi Anna,</p>
<p>The Visio.Application object has an add-ons collection. You can start there&#8230;</p>
<p>Also, for general questions, not related to the Visio Guy article, please try our forum: <a  href="http://www.visguy.com/vgforum" rel="nofollow">http://www.visguy.com/vgforum</a></p>
<p>Cheers,</p>
<p>Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anna</title>
		<link>http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/comment-page-1/#comment-21045</link>
		<dc:creator>Anna</dc:creator>
		<pubDate>Sun, 10 Aug 2008 04:20:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.visguy.com/2008/02/25/edit-visio-masters-programmaticallythe-right-way/#comment-21045</guid>
		<description>Visio experts, please help!

I would like to create a macro to run the add-ons.  Can someone please tell me how? Thanks!</description>
		<content:encoded><![CDATA[<p>Visio experts, please help!</p>
<p>I would like to create a macro to run the add-ons.  Can someone please tell me how? Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 6/26 queries in 0.011 seconds using disk: basic
Object Caching 581/585 objects using disk: basic
Content Delivery Network via N/A

Served from: www.visguy.com @ 2012-02-12 09:39:37 -->
