Add new master to stencil with VB .NET

Hi folks,

I have created a Ribbon-Add-In for Microsoft Visio with Visual Studio 2010 and I really like doing this so far, but I have one major problem that I can't get over.

I try to dynamically change the stencil by reacting to events like ShapeAdded. I managed to delete a master from the stencil by doing something like this:

vsoMaster.Delete()

However, if I want to add a new master to an empty stencil (after all masters have been deleted) I do this:

Dim vMaster = vsApplication.Documents.Item("test.vss").Masters.Add()

This produces an empty master in the stencil.
Now, if I want this master to have a shape, I always get COMExceptions, e.g. when I try to do stuff like this:

vMaster.Shapes.Item(1).CellsSRC(Visio.VisSectionIndices.visSectionObject, Visio.VisRowIndices.visRowLine, Visio.VisCellIndices.visLineColor).FormulaU = "THEMEGUARD(RGB(0,0,0))"

It seems plausible for the program to react like that because there is no shape yet, but I can't find a way to assign a shape to the master.

Does anyone know a way to do that?

Thanks in advance for your help and best regards from Osnabrueck, Germany.

Lennard


0
10/10/2011 6:50:00 PM
visio 3638 articles. 1 followers. Follow

1 Replies
820 Views

Similar Articles

[PageSpeed] 54

On Mon, 10 Oct 2011 18:50:00 GMT, Lennard N. <lennard.nobbe@gmail.com> wrote:

>Hi folks,
>
>I have created a Ribbon-Add-In for Microsoft Visio with Visual Studio 2010 and I really like doing this so far, but I have one major problem that I can't get over.
>
>I try to dynamically change the stencil by reacting to events like ShapeAdded. I managed to delete a master from the stencil by doing something like this:
>
>vsoMaster.Delete()
>
>However, if I want to add a new master to an empty stencil (after all masters have been deleted) I do this:
>
>Dim vMaster = vsApplication.Documents.Item("test.vss").Masters.Add()
>
>This produces an empty master in the stencil.
>Now, if I want this master to have a shape, I always get COMExceptions, e.g. when I try to do stuff like this:
>
>vMaster.Shapes.Item(1).CellsSRC(Visio.VisSectionIndices.visSectionObject, Visio.VisRowIndices.visRowLine, Visio.VisCellIndices.visLineColor).FormulaU = "THEMEGUARD(RGB(0,0,0))"
>
>It seems plausible for the program to react like that because there is no shape yet, but I can't find a way to assign a shape to the master.
>
>Does anyone know a way to do that?
>
>Thanks in advance for your help and best regards from Osnabrueck, Germany.

These newsgroups are no longer in use and it is unlikely that you will get an answer here.
There are replacement forums for Visio, Microsoft's own:
http://social.technet.microsoft.com/Forums/en-US/visiogeneral/threads
http://answers.microsoft.com/en-us/office/forum/visio?page=1&tab=all

or Visio MVP VisioGuy
http://www.visguy.com/vgforum/



-- 
Regards, Paul Herber, Sandrila Ltd.
Electronics for Visio          http://www.sandrila.co.uk/visio-electronics/
Electrical for Visio           http://www.sandrila.co.uk/visio-electrical/
Electronics Packages for Visio http://www.sandrila.co.uk/visio-electronics-packages/

0
paul7909 (8)
10/12/2011 10:00:41 AM
Reply:

Similar Artilces:

Using CRM Application Pool for Custom ASP.NET application
Hi All I am having 2 server based CRM configuration set that is CRM database is on other server, My intallation on multi server went well and CRM is working fine. I have asp.net application which also uses the same database server as CRM and it is deployed on CRM web server. I have added this ASP.NET application to the Application Pool that CRM is using so that I don't have problem in Connecting to Database server however though CRM is able to connect to the database my ASP.NET application is not getting trusted connection on sql server. What am i doing wrong here? Do I have to ...

Add Lookup Fields to Entity
I need to add 4 "technical contact" fields (which would lookup the Contact entity) to the CONTRACT form. Is this possible? I've found it difficult to figure out what to do first. Thanks in advance, Brandon Not possible. You cant have multiple lookups for the same entity. You also cannot create new relationships between two system entitites. This will work in 4.0 Not possible, Pezman. N:M relationships are not possible in 3.0 yet. There is a alternative solution: a new entity to act as an N:M relationship. In your case, Contract/Contact. This entity has two 1:N relations...

Excel Add Ins
What is the name of the template wizard with Data Tracking (Excel. I can not locate the add in template wizard with Data Tracking in Office 2003 Hi Richard You are not the only one<g> The Add-in is working in 2003 only the install file is not working. Copy the xla file from a PC with 2002 to the PC with 2003 and it will work(use Tools>add-ins to browse to the file in Excel) -- Regards Ron de Bruin http://www.rondebruin.nl "Richard" <Richard@discussions.microsoft.com> wrote in message news:193C5DFD-578D-48F7-B9D6-9FEF5BDCEB64@microsoft.com... > What is t...

Opening new Excel window
Windows 2000. When have an exel already open, when I click on another excel file (or its shortcut) it opens into the same excel main window. Then I can view either one of the excel applications by selecting the appropriate window. Is there a setting such that new excel will open in its own window? If so, how? [Currently I can get this effect in a less convenient way by starting the excel directly the second time, and then reading in the excel file.] Alan Beban You could have one instance of excel open and have multiple "tasks" appearing on the taskbar via: Tools|optio...

Add on
Hello, Here is a scenerio. A client is buying 1lb of ham. It is put on a waxed paper then wrapped into a white paper and then put into a shopping bag. The usage of shopping bag is 100% cases the usage of paper is only with certin categories of sales. Same with the waxed paper. Question: Is there a way of associating wax paper, white paper and shopping bags in a way so with every sale a piece of paper gets deducted from inventory and one bag is deducted from inventory? I would like to run a report every so often and see if I need to purchase any supplies. Kits and assembly do not work...

Detect Net Stop
Hi, How does a driver detect a "net stop" request (if possible)? TIA!! If you mean the command NET STOP <driver service> the driver will get a call to the unload routine for a legacy driver, for a PNP driver this command does not work. -- Don Burn (MVP, Windows DKD) Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr Remove StopSpam to reply "David F." <df2705@community.nospam> wrote in message news:3EEF0CD9-6FC7-40E9-8FD2-FB736A5C512E@microsoft.com... > Hi, > &...

add a row or column to a single cell in exel
I am trying to split a single cell into 2 rows can you help If I understood correctly you want to enter an entry in two lines in a cell at appropirate place hit lt+enter and again hit enter for e.g venkat (alt+enter) raman(enter) "trev" <trev@discussions.microsoft.com> wrote in message news:89B2C15C-057F-43B9-8282-37923D5EA397@microsoft.com... > I am trying to split a single cell into 2 rows can you help ...

way to delete add. fr. auto. email add. function?
Is there a way to delete old or no longer used email addresses that appear in the drop down box when I am addressing a new email? Shebubba wrote: > Is there a way to delete old or no longer used email addresses that appear in > the drop down box when I am addressing a new email? That is the nickname cache. Search and delete the .nk2 file. That's the cache for nicknames (i.e., your manually entered e-mail addresses). If you only want to delete some of them, highlight an entry and hit the delete key. If that doesn't work, use Nirsoft's NK2 Viewer utility (it e...

POS 2009 Add-In: Populating a Task Pad
I would like to create a custom application that has the ability to maintain the items that are on certain Task Pads within POS 2009. These items would all be regular menu items (ex: hamburger, hot dog, french fries, etc) and not functions. For example, if a task pad was supposed to allow the cashier quick access to daily specials, then this custom application would need to be able to clear the task pad each day and add the items for that day. Is this going to be possible? Please provide some guidance. Thank you, Sean This is a multi-part message in MIME format. ------=_NextPart_00...

copy entire contents worksheet into new workbook, link but editabl
I need to copy the entire contents of a worksheet which is used by several collegues who need to see it looking the same always (headers in the same order,etc). In the new worksheet (workbook) I will rearrange the data for other purposes. However, I will need the data to be kept up-to-date as per the source worksheet. ...

Add-in cannot be loaded OL07
Every time I open Outlook 2007 I get an error message regarding an add-in 'DCCExtensions' (DCCEXT32.DLL). It says the add-in cannot be loaded and has been disabled by Outlook. I've been getting this message ever since I uninstalled Winfax. How do I make this error stop appearing? Thanks. -- kapibarra Remove the addin from OL by using Trust Center, Addins. http://office.microsoft.com/en-us/outlook/HA100341271033.aspx#14 "kapibarra" wrote: > Every time I open Outlook 2007 I get an error > message regarding an add-in 'DCCExtensions' (DCCEXT32.DLL). ...

Format text to add character
I have two fields that should match, but one includes special characters while the other does not. Example: Field1 00ABCD123456123 Filed2 00/ABCD/123456/123/SBZ I need to find records where these two fields don't match, either by changing the display of one of them, or a query to compare Field1 character 7-15 with Field2 characters 9-14, 16-18. Hope this makes sense. Can anyone help? Thanks! Take a look at the following from the Access Help file it might be what you're looking for... Extract a part of a text value The following table lists examples of expressions that ...

Add File menu to custom toolbar
Hi All, I am trying to add the 'File" menu and "Window" menu of the Standard Toolbar to a custom toolbar but failing miserably! I think it should look something like: Sub AddMenuTitles() Application.CommandBars("MyCustomMenu").Controls.Add("File) Application.CommandBars("MyCustomMenu").Controls.Add("Window") End Sub Can anybody help please Regards Michael Sub test() AddMenuTitles True ' or false to delete End Sub Sub AddMenuTitles(bAdd As Boolean) Dim cbr As CommandBar Dim cbP As CommandBarPopup ...

add a DC in a LegSite
Hi, In the disaster recovery plan we want to create a leg site and put a DC in it. Here are some questions on how to achieve this smoothly. 1. Should I create the new site/subnet first and then promote a server in that subnet/site to DC, or should I promote a server in existing site/subnet and then move this DC to the new site/subnet? 2. When promoting a server to DC, should the server be a member server (already joined the domain) or just a workgroup member (no domain membership)? 3. The DC will be an AD-integrated DNS server. Should I install the DNS component (but not confi...

How does excel note a newline (ie new line but in same cell)
Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi <br> Have legal transcription i need to manipulate partly in excel on mac. want each cell to be one question or answer in deposition, but can't allow excel to wrap the text of the question or answer, which is typically several lines, as in depositions each line is numbered and i want to preserve the numbers matching the lines. so i would like to manually add the character/formatting in my text editor before i bring the text back into excel. <br><br>or perhaps i can write an excel macro or f...

How can I add the customer's PO# to the drop-ship Purchase Order?
Our purchasing agent would like to be able to have the customers PO# from the Sales Transaction Entry screen show up on the PO's. Is this doable in Report Writer or can it not be done? We are using GP v9.0. As I still consider myself a newbie with RW, I would appreciate detailed instructions if possible. Thank you in advance for all responses. It is not possible thru traditional table relationships in Report Writer. Let me explain: you can certainly link the Purchase Order Work table to the SOP_POLink table and the SOP_POLink table to the SOP Transactions Work table, but will...

excel add-ons
Awhile back, there was an add-on for excel that had a lot more tools. It showed on the toolbar. Somehow I lost it and I would like to get it back. It had a lot of tools like for changing case and fill ins. Any help wouyld be great. Maybe ASAP Utilities. Try a 'net search for this add-in. Gord Dibben MS Excel MVP On Sun, 22 Mar 2009 20:22:43 -0400, "kmkx70a" <kmkx70a@prodigy.net> wrote: >Awhile back, there was an add-on for excel that had a lot more tools. It >showed on the toolbar. Somehow I lost it and I would like to get it back. It >had a lot of t...

Having OL automatically add a bcc: address
My boss wants to add me as a bcc: to every email she sends. Is there a way to set this up to happen automatically? Please reply to matt@lkigroup.com Thanks much. Matt ...

Creating a new list with Last Order Date
I do have a customer transaction history. I would like to get the latest order date with amount in to another sheet instead of all the orders under same account number and bring the rest of the corresponding info to the other columns. Such as bill to information for my new sales rep. Can someone help me? Thanks Vedat A2=Customer Number B2=Order numbers C2=Order dates D2=Order Amounts D3=Bill to Name etc. A2 B2 C2 D2 CA123 1234 10/11/06 $500 CA123 2345 09/10/06 $200 CA123...

Moving Exchange 2k to new Exchange 2k server
I have an Exchange 2k server. Two hard drives (one for OS and one for data). Both are quickly running out of space and the hardware is slow. I want to upgrade my hardware (faster computer, & larger hard drives), but I want to stick with Exchange 2k for now. What is the best way to go about this? Also, in looking at the way this server was setup, I don't understand where the m:/exchange drive exists. Do all Exchange servers have a m:/exchange drive. It seems to be part of the C: drive (always has exactly the same space used as if they were mirrored) but different data. Ca...

Map Add-On?
I am looking for an Excel Chart add on so that I can take numerical data and display it on a geographic map of states or zip codes for example. Even better I could color or shade a state based on the values in my spreadsheet. Any suggestions would be appreciated. Mark ...

New license key for upgrades from 3.0 to 4.0
Is there a process for obtaining a new license key that will be accepted during an upgrade from 3.0 to 4.0. My current 3.0 license is not being accepted! Thanks in advance, ~Maria Trial license keys are provided inthe readme that comes with the downloads. The rpocess for getting the "real" keys has not been announced. -- Matt Parks MVP - Dynamics CRM "Maria Greendyk" <MariaGreendyk@discussions.microsoft.com> wrote in message news:D5CAE82E-A779-4FFD-9D72-3E0E02D3580C@microsoft.com... Is there a process for obtaining a new license key that will be accepted d...

New mail notification #2
Is there a way to have the new mail notification box/window stay up longer than 30 seconds in Outlook 2003 like you used to be able to do in older versions of Outlook (i.e. like Outlook 2000)? I am not talking about the little envelope that appears in the task bar, but the notification box window that appears in the lower corner of the screen (used to appear right in the middle of the scree). Thanks Sounds like you're asking about the popup notification window from MSN Messenger when it detects you have new e-mails. -- ____________________________________________________________...

New investment
How can I add new slovenian investment which is valued in SIT (Slovenski Tolar). In form where I must select country, Slovenia is not on a list. Old investments, inserted in previous version of Money (95 I think) works ok. Thanks Marko ...

Setting Defaults in New Item Wizard
How can I set a default value in the New Item Wizard? I want to always use a barcode type that is about 10 down from the top and I want Taxable Item to always be checked. Help... Good question, I need an answer too. "A StanTech Associate" wrote: > How can I set a default value in the New Item Wizard? I want to always use a > barcode type that is about 10 down from the top and I want Taxable Item to > always be checked. Help... You can set the default sales tax under Manager, File, Configuration, Sales Tax, Default item tax group. To set a default barcode type yo...