Help with Stencil Master Naming Problem

G

Gary

I have two master objects in my Stencil. The master names for each of them
are Z-R.2 and Y-R.2

When I select the master object in the Stencil and check the master name,
they are Z-R.2 and Y-R.2 for them. I am using VBA Code in MS Access to
drop the master object onto my visio application. Below is what I do:

Application.ActiveWindow.Page.Drop
Application.Documents.Item("C:\Stencils\Stencil_R1.vss").Masters.ItemU("Y-R.2"), 1.5, 1.0625

This is what I expected, because the recorder reference it by the master
name of Y-R.2


The problem is this one.

Application.ActiveWindow.Page.Drop Application.Documents.Item
("C:\Stencils\Stencil_R1.vss").Masters.ItemU("Master.5"), 1.375, 2#

Instead of using Z-R.2 master name, the record shows Master.5. What do I
need to do the change my stencil master to be called by Z-R.2 ??? The master
name shows this.

Can Some One Please Help.


Gary
 
J

JuneTheSecond

Masters collection does not have ItemFromNameU property.
My ides is to use for each loop, for example,
Dim ms as Master
For Each ms In doc.Masters
Debug.Print ms.NameU
If ms.NameU = "Measure tool" Then
ActivePage.Drop ms, 4, 4
End If
Next
 
G

Gary

Can you help explain how I luck out in the first case?? Is there a way to
repeat what I had the first time without writing this loop for all??

Thanks,

Gary
 
M

Mark Nelson [MS]

You may have a master with local name = "Z-R.2" and a universal name =
"Master.5". Check the Master.Name and Master.NameU properties to confirm
this. Then programmatically set the Name and NameU properties to the same
thing.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top