Visio Guy

Visio Discussions => Visio Bugs (er...Issues) => Topic started by: Eva on April 21, 2017, 06:25:42 AM

Title: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Eva on April 21, 2017, 06:25:42 AM
I have a strange issue with Visio 2016 on windows 10 machine. The same thing works ok in Windows 7 environment. When I copy some master from a stencil to the clipboard and then try "paste shortcut" to another stencil,  Visio either crashes or gives an error message: "An error (1) occurred during the action Paste Shortcut. Unexpected end of file." The same error occurs with any masters. I have tried this on two different machines, and both have the same error. I tried to find out if someone else had the same error, but I did not find anything. Does anyone know why this fault comes?
Thanks,
Eva
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Surrogate on April 21, 2017, 08:01:05 AM
you can read about Error #1 this article - Article 27. "Information catharsis" (https://translate.google.ru/translate?sl=ru&tl=en&js=y&prev=_t&hl=ru&ie=UTF-8&u=http%3A%2F%2Fwww.prodigitall.narod.ru%2Farticles%2Farticle27.html&edit-text=&act=url), via google transtate (https://translate.google.ru)
you can find how fix this error in this thread An error (1) occurred during the action Copy (https://answers.microsoft.com/en-us/office/forum/office_2003-visio/an-error-1-occurred-during-the-action-copy/1dcba096-00bf-42f2-9fff-ffd15b569dc8)
But these methods can work only with Visio 2010 and older versions  :-[
Newest versions don't support xml conversion !
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Eva on April 21, 2017, 09:22:15 AM
Thanks for the quick response but the active Visio drawing has nothing to do with this error, and that's why the fix does not help in this case. The same fault will also come with a new, empty vision drawing and with any master. I also tried to disable all addins.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Surrogate on April 21, 2017, 09:27:53 AM
Eva, please describe all your steps. And share your documents.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Eva on April 21, 2017, 09:39:24 AM
1. I create a new blank drawing in Visio 2016 in Windows 10 computer
2. I select More Shapes - General - Basic Shapes
3. I select for example Rectangle master and Copy it to clipboard
4. Then I select More Shapes - New Stencil (Metric)
5. On the new stencil, I right-click and select "Paste Shortcut"
6. Visio shows an error message: An error (1) occurred during the action Paste Shortcut. Unexpected end of file.
Sometimes Visio has crasched without any message.

I tried this also one colleague's machine with the same result.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Surrogate on April 21, 2017, 09:46:14 AM
Why you paste that master as shortcut ? Not as master ?

UPDATE: in my case all these steps works !
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Eva on April 21, 2017, 09:54:44 AM
I have two reasons:
1. Shortcut takes less disk space when the stencil is saved
2. Shortcut will stay up-to-date, if the original shape is modified
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Surrogate on April 21, 2017, 10:02:43 AM
Quote from: Eva on April 21, 2017, 09:54:44 AM
1. Shortcut takes less disk space when the stencil is saved
In these days HDD have big volumes
Quote from: Eva on April 21, 2017, 09:54:44 AM
2. Shortcut will stay up-to-date, if the original shape is modified
in my case, i can paste as shortcut only build-in masters from MS provided stencils. but when i try paste as shortcut custom master my visio application falls !
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Yacine on April 21, 2017, 10:06:43 AM
??? That's not how stencils were meant to be used.
Actually the stencil should be the original storage place for shapes to reuse, not external files with links in the stencil.
You may have just found the reason for the crashes.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Eva on April 21, 2017, 10:26:39 AM
The reason why I use this is that I maintain an Visio add-in which has a search feature. With this feature the user can write some keywords in Excel and then search for the masters containing these words. The feature copies the shortcuts of the found masters to a new stencil, and the user can then use this stencil as a quick way to find all the needed masters. In previous Visio versions, this has worked well and works also with Visio 2016 on Windows 7.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Surrogate on April 21, 2017, 10:31:17 AM
In my case Visio 2010 & Win7 this hint dont work
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Yacine on April 21, 2017, 11:45:21 AM
Quote from: Eva on April 21, 2017, 10:26:39 AM
The reason why I use this is that I maintain an Visio add-in which has a search feature. With this feature the user can write some keywords in Excel and then search for the masters containing these words. The feature copies the shortcuts of the found masters to a new stencil, and the user can then use this stencil as a quick way to find all the needed masters. In previous Visio versions, this has worked well and works also with Visio 2016 on Windows 7.
Guess you were not happy with the built-in search function.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Yacine on April 21, 2017, 11:49:21 AM
If direct pasting of a shortcut does not work anymore, you may investigate the possibility to insert a blank master and modify it programmatically afterward?
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Eva on April 21, 2017, 12:22:28 PM
I am not happy with the built-in search function, because I haven't found any way to search shapes in my own stencils. The built-in search only search for shapes that are installed with Visio?

Now I tried to change the feature so that it I use "paste" instead of "paste shortcut".  This seems to work, but now the found masters are copies, not links any more, and if the original master is updated, the copy becomes obsolete.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Yacine on April 21, 2017, 07:11:43 PM
When a user drops the master on the drawing a local copy is made anyway. A change in the original master will not affect the dropped instances. I wouldn't know for a mechanism that keeps the link alive.
And as the "help"-stencil is generated dynamically, the should not be a problem with obsolete masters.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Eva on April 22, 2017, 07:41:38 AM
I don't drop the shortcut into a drawing, but in a stencil. It is possible to create a link to a master:
1. Create a shape and drop it in your own stencil ST1.
2. Copy the master (in the stencil) to clipboard and drop a shortcut into a new stencil ST2
3. Save both stencils.
4. Edit the original master in the stencil ST1
5. Create a new drawing, open the stencil ST2 and drag and drop the shortcut into the drawing.
The icon of the shortcut in the stencil ST2 looks still the same as the original master, but when dropped into the drawing, it is the new one.
I think this is a link. And you can save the stencil which includes shortcuts, you don't have to create it dynamically.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Yacine on April 22, 2017, 12:35:13 PM
Just for being clear - is this your scenario?
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Yacine on April 22, 2017, 12:46:04 PM
Just tried your description of the process with Visio 2013 and Windows 7. It works as you described.

BUT: I understand that the "work stencil" is generated by a search tool, thus the masters in ST2 are always up-to-date. The shapes already dropped in the drawing itself don't update.
So I don't understand why a link is needed instead of a "fresh" copy of the master.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Nikolay on April 22, 2017, 01:54:57 PM
Dear Eva,
I was also able to reproduce the thing ("Paste Shortcut" does not work in Visio 2016 on Windows 10).
Steps are exactly the same as you describe.

If you have support requests from M$, and you need this thing to be fixed, then probably it's time to use it.
I don't think that anybody except Visio development team can fix that - looks like a 100% bug :)
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Nikolay on April 22, 2017, 02:15:15 PM
Quote from: Eva on April 21, 2017, 12:22:28 PM
I am not happy with the built-in search function, because I haven't found any way to search shapes in my own stencils. The built-in search only search for shapes that are installed with Visio?

The built-in search works for all shapes. but. This is a long-standing pain point. For shape search to work you need:
- Enable the search service (make sure it's up and running - it is enabled by default but some "optimizers" tend to turn it off for performance reasons)
- Ensure that the location (folder) where you keep your stencils is included in the search index (check Indexing Options).
- Wait a bit for the search service to re-index your content. It won't pick up immediately.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Eva on April 24, 2017, 05:12:46 AM
Thank you!
Yacine, you're right that the shapes do not stay up-to-date in the drawing, but anyway the "search stencil" is useful.
Your drawing about the search idea is quite right, except that the "search stencil" is not meant to be temporary. The user can save it and use as long as he needs.

Nikolay, thank you for information. Now I know I should not try to get the shortcut to work, but I must change the function.
The built-in search is not worth using in this case because even if I can get it work on my own machine, it's too complicated to instruct all users.

Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Nikolay on April 24, 2017, 10:38:57 AM
Quote from: Eva on April 24, 2017, 05:12:46 AM
The built-in search is not worth using in this case because even if I can get it work on my own machine, it's too complicated to instruct all users.

By default, it should work. No special setup is required.
Means, "My Documents" folder is included in the search index by default. So if you put the stencils there (or in any sub-folder of "Documents"), the search should pick them up.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Eva on April 25, 2017, 05:56:52 AM
The stencils of my tool are not in My Documents folder or sub-folder. And this search feature should only search in the stencils of this tool, not in all Visio stencils. In addition, my search does not search not only in the master's name but also inside some shape data values. But I admit that the built-in search is much faster than my special search. If I could get it work easily in all user's machine, it would be better.
Title: Re: Copy master to clipboard- paste shortcut to a stencil - error
Post by: Eva on April 25, 2017, 07:24:17 AM
I have tried the built-in search, and found that it really works fast. But I noticed that it also uses master shortcuts. Somehow it works, even if I can't create master shortcuts manually. ?