Solved

Locking size of shapes inserted into powerpoint slide using vba addin

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Inserting Dynamic Text into Powerpoint 16 130
Convert VB6 MSXML2.ServerXMLHTTP process to C# 2 41
Plain Text Editor for iPad 6 60
fso.FolderExists("\\server\HiddenFolder$") 4 51
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've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This video teaches viewers how to fit pictures into slides, crop and remove backgrounds, and alter photos to look more professional.

911 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

19 Experts available now in Live!

Get 1:1 Help Now