Solved

Locking size of shapes inserted into powerpoint slide using vba addin

Posted on 2013-11-20
4
1,688 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about a problem I had getting the GPS LocationListener working.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

760 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now