Solved

Locking size of shapes inserted into powerpoint slide using vba addin

Posted on 2013-11-20
4
1,793 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
Part One of the two-part Q&A series with MalwareTech.
The viewer will learn how to edit text. This includes Font, Spacing, Resizing, Color, and other special text options.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

632 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