Solved

Locking size of shapes inserted into powerpoint slide using vba addin

Posted on 2013-11-20
4
1,729 Views
Last Modified: 2013-11-20
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
Comment
Question by:jessica2013
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:JSRWilson
ID: 39662896
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
 

Author Comment

by:jessica2013
ID: 39663011
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
 
LVL 23

Accepted Solution

by:
JSRWilson earned 500 total points
ID: 39663162
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
 

Author Comment

by:jessica2013
ID: 39663301
Ok, thanks - might have to look at other options. Appreciate the help
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will learn how to edit text. This includes Font, Spacing, Resizing, Color, and other special text options.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question