Is it possible to create a layer (programmatically) on a specific slide in PowerPoint?
A layer here I mean a place holder that is allowed to contain multiple shapes. If we delete this layer, all its sub-shapes will be deleted.
Note: I am using visual studio ultimate 2013, C#, vsto, powerpoint 2013, and 2010.
It's not possible in PowerPoint.
You could say that PPT doesn't have layers, or you could say that each shape sits on its own layer.
But you can group multiple shapes; this produces a single shape that's effectively on its own layer and if the group shape is deleted, all the shapes that constitute the group are deleted.
Related
I work on drawings prepared by others. At the moment, I XREF the drawings into my own template and I have my Layers and Filters set to my preferences. However, I have to edit the XREF and create my own layers and filters within the other drawing - every time - twice a day. I want to export my filters to the drawing. I use AutoCAD 2014 and the option to export my filters to another drawing is not available. Apparantly, the option was available in earlier versions of AutoCAD but not mine. However, other Autodesk products do have this option (3DCivils, Architecture) so it is possible to export the layer filters.
I have tried to find a VBA method to do this but I have been unable to find the VBA property or method to read the filters. Moving the layers is easy, but not the filters. The forums say there is no method. Therefore, would it be possible to create an add-in that would manipulate the Layer Manager and create my Layer Filters. I would have a button that would run the macro.
I suspect I will have to write a .NET routine but is what I am trying to achieve 'do-able'.
This is definitely 'do-able'. Kean has a very clear article covering this topic. Once you read them you could either serialize them to a file (like XML) for export and have another routine just for populating new drawings or if you have both drawings open, just change the database the layers and filters need to be read/written to.
PowerPoint added native capability for picture transparency (without having to create a shape) in late 2018. See that linked article to see what I mean.
I'm trying to figure out what/if an appropriate VBA object exists for it (there's not much online since it's a fairly new feature). I've tried the traditional FillFormat.Transparency object, as well as a few other analogous attempts. (Basically, have been searching the VBA documentation up and down for an hour or two).
Any thoughts?
Currently, there is no way to set the Picture Transparency directly (without using a Shape Fill). You would notice that the Shape properties are arranged somewhat as it appears on the Picture Tools Pane. For example, the Picture settings are on the last tab (where you have Picture Corrections, Color, Transparency and Crop). These are all accessible with the Shape.PictureFormat object. (The .FillFormat is only applicable when you are filling a shape).
You will notice the .PictureFormat has Properties relating to the aforementioned settings, except for Picture Transparency. The .PictureFormat.TransparencyColor cannot be used to set the degree of transparency.
The PowerPoint VBA object model often lags well behind new features that appear in the user interface, so there's nothing available yet to do what you want.
Just a note, when it appears, transparency will be a property, not an object. The current TransparencyColor and TransparentBackground properties are for the old routine that creates a single picture color that is 100% transparent.
I downloaded an OpenOffice Draw document with shapes I want to use (for drawing Apache Camel diagrams). I'm not very familiar with Draw, but I've used Visio; in Visio, there was a kind of file in which you could find/put shapes, then use to create drawings from those shapes. The shapes appeared in a panel left of and smaller than the drawing, and you could drag a shape from that panel to the drawing to put an instance of that shape on your drawing; the original shape remained on the smaller panel.
I think Visio called the file that held the shapes you could use a "template"; Draw has templates, but I haven't found a reference to them holding shapes to drag onto a drawing. I've tried looking it up, but am hampered by not knowing what terms Draw uses for these things. Can someone tell me whether this is possible in Draw, and what things I should look up help on? I hate to read a whole manual to find out how to use one feature, without even knowing if the feature exists...
--
I'm sorry, I should have done better describing what I have tried. The file holding the shapes is an odg file; it opens fine as a document, and the program allows me to save it as a template, but the behavior of being a collection of shapes that I can drag onto a new drawing repeatedly, without having to copy a shape each time, is not there. That's the feature I'm trying to find.
My version (LO 5.2.3.3/openSuse) allows the creation of a new shape gallery theme (see: View>Clipart Gallery), and the addition of various graphic format files to that theme.
Also, in context meni of a shape, I can edit with external program.
So, I guess, you can save the shape(s) in a file and add it to My Shapes theme.
There will be two new files in ~/.config/libreoffice/5/user/gallery with the shape(s), to backup/restore (to a new installation) or distribution (to other computers).
Edit if your version of the office suite is lacking of that menu options, maybe you can extract the shapes from the *.odg file: unzip it and look for a custom *.sdv and *.thm file in the archive.
I am working on a CBIR (Context Image Retrieval) project,
I am creating PowerPoint slides, that include many shapes and simple pictures(e.g sun, ball, chair..).
I'm using a VBA code to retrieve the COLOR(fill,background) feature of the object/shapes in the slide.
But, I can't get it for the pictures(jpeg/wmf) objects.
How to retrieve the picture's color by VBA code? Since Clip Art is no longer available on PowerPoint, are there any other picture libraries recognized by PowerPoint?
In the PowerPoint object model, pictures are seen as sort of collections of stuff that PowerPoint knows nothing about. You'd have to ungroup the picture (or a copy of it that you later delete) in order to retrieve colors from the individual shapes within the picture. That assumes that it's a vector picture and contains only vector shapes. You can't do much at all with a raster image w/o resorting to external libraries and more complex programming.
Have a wierd request.
I have a powerpoint add-in which allows to quickly insert shapes and graphics (also shapes) to the presentation.
It works ok, but the obvious problem I see now is performance, as I store shapes in seperate pptx file.
There are 2 ways I approached working with the shape insertion:
1. Store everything in one presentation and keep it open in the background. The downside is that it makes powerpoint really slow, because the file is just too big (more than 8 mb)
2. Store every slide as a seperate file and open it as needed. This just makes the programm slower, than usual, but works fine. The key downside is that PowerPoint stores every open file in the register and you can not use "recent file" features of the PPT.
What I hoped was possible to do is to save each shape from powerpoint that I heed as seperate file and insert them individually, which would significantly increase the speed of my add-in. However, the only thing I could do is just expoer shape as EMF, which is unacceptable for me.
So my question is: is it possible to export PowerPoint shape in custom format and then import it back to powerpoint? I am using VB.net and VS 2013
Team foundation addin for VS 2013 does something similar, but I need to understant the code and logic behind it and have no idea for now.
You help is HIGHLY appreciated.
Iakov