• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1871
  • Last Modified:

Locking size of shapes inserted into powerpoint slide using vba addin

I am writing a VBA add-in to do various things, eg. create agenda slides, insert summary boxes etc. But, we have a specific shape that we are using as the arrow on these slides, and I want to be able to lock the size of this shape so it's position can move but not the size. This add-in will be rolled out across the whole company for their use when building presentations so something like ShapeLocker is not an option. Is there any way to do this?
0
jessica2013
Asked:
jessica2013
  • 2
  • 2
1 Solution
 
JSRWilsonCommented:
Hi Jessica

Shapes are locked in the XML code of the presentation. You CAN access this from vba but it's not simple.

I would suggest having a library slide that contains only the locked arrow. If you have shapelocker you could use this but it is quite simple to lock shapes manually if you have an XML editor.

Then from the vba open the library slide without a window (ie invisibly) and copy paste the arrow into the presentation being created. Alternatively you could make the arrow an image and insert as normal from a folder.

Hope that makes sense. If you need more help than it's feasible to give here you should be able to find our website in my profile and > Contact Page. Don't worry I'm not looking to bill you!.

Examples of locked for resize arrows (shape and image) here
0
 
jessica2013Author Commented:
Hi

Thanks for the prompt answer.

Yes, I know how to lock shapes in XML, so I suppose I was looking for whether and how you do that from VBA? The problem with a library slide is that people need to be able to access this when they aren't onsite, so they won't necessarily be on a network. I would much rather everything was self contained really, but we are trying to keep the template as simple as possible and do everything with VBA. Do you have any examples of accessing xml from vba that i could use as a starting point?

Jess
0
 
JSRWilsonCommented:
I have dabbled with it in vba to modify XML but it's pretty tricky.

I'm no expert at this in vba (much easier in vb.net & OpenXML SDK)

I saved a copy and unzipped it to get to the correct part and then loaded the part to the Document object model (referenced xml 6.0 ) Made the change (not easy) and then replaced the original file with copy.

I don't suggest it

This was my start point
http://msdn.microsoft.com/en-us/library/office/dd819387%28v=office.12%29.aspx

Are you sure the library file won't work.

How are you distributing the ppam AddIn? If you use an msi installer you can include the library file and drop it into a hidden folder on the users PC (say <APPDATA>\jess\).
0
 
jessica2013Author Commented:
Ok, thanks - might have to look at other options. Appreciate the help
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now