News:

Happy New Year!

Main Menu

Programmatically remove custom properties

Started by kpnekvasil, January 26, 2013, 03:59:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kpnekvasil

Has anyone ever removed custom properties using VBA? We have drawings that we create for customers that have a lot built in custom properties. We want to give them the drawings so they can edit later but we don't want them to have all the background work we have done via the custom properties. Any thoughts?

aledlund

I know it's come up before. It's merely selecting the custom property section, get the count of rows and then remove them starting at the back and moving to the front.

http://msdn.microsoft.com/en-us/library/office/aa224575(v=office.11).aspx

al

Yacine

further to al's answer, you might want to identify your shapes by means of an ID stored in the user section, so you can restore the custom properties, once you get them updated back from your customers.
Yacine

kpnekvasil

Thank you for the link!

Basically we don't want our end customer to have the custom data and infrastructure behind it. We have multiple things going on such as altering shape size/look/color, formulas and a few other things. Once we create drawings for the customer we don't want them to have that capability in the drawing we send them.

Paul Herber

 ... or just delete the entire section in one go ...
http://msdn.microsoft.com/en-us/library/office/aa224576%28v=office.11%29.aspx

Be aware though that deleting the cell/row/section may break the shape. Any formulae that reference the custom properties will no longer work correctly.

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 223 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1075KB.
Tokens: post-login.
Cache hits: 15: 0.00312s for 26,592 bytes (show)
Cache misses: 5: (show)
Queries used: 18.

[Show Queries]