Is there a way to setup a series of PowerPoint presentations, say in the same folder, then setup one master powerpoint that when presented will import the slides in the folder to form one slideshow?
We, like many offices have slides that need to be updated by about a dozen people in the same hour, and I'm wondering if there isn't an easier way to just separate the slides out physically, then present them together logically without any manual overhead, since this isn't a very technically minded group.
I can't seem to find the right search terms for what I want to do, but I did try googling first :).
You can do this programmatically, as in:
Sub InsertOtherDecks()
Dim x As Presentation
Set x = ActivePresentation
x.Slides.InsertFromFile ("myslidedeck.pptx")
End Sub
You can also certainly do this via the client, but depending how much you need this and the control required Slides.InserFromFile offers easier control over inserting from many different decks. But here's the manual version:
Related
I've got a dozen macros that have 90% similar code. I've created 4 sets of VBA in an add-in file so that I don't have to revise a dozen different places any time a change needs to be made. The plan is to end up with:
specific code
universal code A
specific code
universal code B
The users are not particularly tech-savvy so I want to make the distribution as painless and idiot-proof as possible.
Also, the add-ins don't have to be visible--no one is going to run them on their own, they're just going to be embedded and called upon from other macros.
I've looked around online and the closest thing I've found is this How to combine multiple VBA macros into one add-in file for Excel
It still looks like this is geared more towards having multiple buttons, which I really don't need (or want...I don't actually want ANY buttons)
Not really sure what kind of code I could show to help with this problem, since I don't know if this is even possible to do.
Once you save the XLAM file you just have to click on Excel Add-ins under the Developer tab, browse to the folder where it is stored, and open. It will then appear as an add-in package that you can click on.
I've made a form-letter document with a macro that performs the mail merge. I don't want the user to have run it from the menus, and I want this to be portable. If there's a way for a button to appear on each user's ribbon or quick command menu, I'm not familiar with it.
So I put a button in the document itself. Unfortunately, every form-letter created has the same button in it. I suppose I could write the code to delete every one, but I think that would be slow.
Is there a way to assign a shortcut key to an existing macro, and have it reside in the document?
I had to implement something pretty similar to what you were referring to some 10 staff. My solution (by no means as portable as desired) was to export the macros and forms from my Normal template to the other users, I coupled this with Ribbon customization and it worked well. Unfortunately, when a change was needed, I had to trudge over to everyone's machine individually.
I would suggest you stick with your solution of deleting button after the merge is complete. Here's some code to help with that:
Sub DeleteCommandButton()
For Each o In ActiveDocument.InlineShapes
If o.OLEFormat.Object.Name = "CommandButton1" Then
o.Delete
End If
Next
End Sub
Good luck, hopefully this helps.
I refer specifically to the 2016 version, but this should also apply to 2013 and 2010.
----- TLDR Summary
Is it possible to use VBA to add a new Slide Master using a method
that I haven't found?
Is it possible to use VBA to access or manipulate the Layouts of
Slide Masters other than the first one in a Presentation object?
I suspect that the answer to both is "No" and that MS has merely
screwed up the exposure of the underlying objects, but others may
know more about programming PPT than me.
------ The Whole Question
Microsoft has deemed PowerPoint unworthy of a macro recorder for lo these many versions (I think it was dropped in either 2003 or 2007 from memory), so no help can be obtained from there.
The linked MSDN "help" item is woeful. It states that the property returns a Master object, though that isn't relevant for the moment.
An Office support page describes a slide master here. A Slide Master seems to be where the presentation's Slide Layouts live, presumably in the SlideMaster's CustomLayouts property, though it's interesting to note that only the first 9 of those CustomLayouts correspond to what you see in the GUI. (I count 11 CustomLayout objects in the SlideMaster in a new, blank presentation.) The numbers change if you add new layouts though the two vertical text layouts never seem to appear in the GUI list. This too is not the problem.
The problem is that you can in fact have more than one Slide Master per presentation by going to the View menu, Slide Master, and then selecting Insert Slide Master. Having multiple Slide Masters is discussed on the Office Support site here.
Frankly I regard this functionality as slightly broken because if you do that, then apply a Theme to the new Slide Master, you end up with a third Slide Master; the original under "Office Theme", a second under "Custom Design", and a third under the name of the Theme that you applied. This too is not in itself a problem. (Though it's worth noting that a Presentation does not have an AddSlideMaster method, which means that it does not seem to be possible to do this by VBA. Not that you necessarily want to, but if you did, you can't. There is only an .AddTitleMaster method which seems to be useless since all presentations have a TitleMaster as far as I can see and if a presentation has one then that method will error out according to the documentation.)
The problem is that the Presentation object does not have a collection of Slide Masters. It has only that one property, SlideMaster, which returns a single Slide Master / Master object.
Accordingly I can't see any way that you can programmatically add a new Slide Master. And even if you used one that is added through the GUI you can't seem to access any Slide Master except for the first one. And therefore you don't seem to be able to access, manipulate or assign any Layout from any Slide Master other than the first one to an individual slide.
Am I correct in this assumption, or am I missing something?
I shall offer thanks in advance even though that is often deleted from questions. Not that this one is likely to attract much attention; I suspect that there may be another Tumbleweed badge in my future.
Perhaps this page will be helpful in understanding it better - http://skp.mvps.org/2007/ppt003.htm
Let me explain the context:
I have a huge training material (some 750 slides, for a two-days training) to rework.
Even though it is considered a "in-depth training", not all the material is useful for a given two-days session. Depending on the trainees profile, a chapter can either be fully presented with practical advices, or only the overview is given.
This means, before every session, I review the material and manually select which slides will be presented/hidden according to the trainees profile.
As I've never used VBA macros on Powerpoint, I was wondering if it is possible to, say, "tag" the slides with one or several roles (e.g. slide for "system designer", slide for "certification specialist", slide for "system designer + certification manager", etc...), and then by a simple form, check the "tags" you want and automatically generate the related presentation with the tagged slides accordingly.
For example, if for a given training session I have no system designer, but I have certification specialists and managers, I will check "certification specialist" and "certification manager" and it will generate me the presentation with only the slides that have those tags.
I hope I was clear enough...
Many thanks in advance !
Morgan
Yes, this would be possible. Using VBA, you could tag the slides (there actually ARE things called tags in the object model), then have a routine make any slides tagged a certain way visible and all others invisible.
To add a tag to the currently selected slide, you'd do something like this to identify all of the currently selected slides as being material for Certification Specialists. Slides can have multiple tags, so you can mod the same code to make it tag them for the other types of audience as well.
Sub TagAsCertificationSpecialist()
Dim x As Long
For x = 1 To ActiveWindow.Selection.SlideRange.Count
ActiveWindow.Selection.SlideRange(x).Tags.Add "CertificationSpecialist", "YES"
Next
End Sub
I am working on a Word VBA macro app for 80 or so users. The office has high staff turnover, so training suffers, and so one of the self imposed requirements for this project is comprehensive, friendly documentation. However, to supplement this, and to save newbies having to open up a 100 page document when they want to try something new, I want a status bar on every userform (there are five) that provides contextual help. I find tooltips annoying.
I don't have a lot of experience, so I was wanting to
Essentially, I have a file containing every status string. (This is currently a text file, but I was wondering if I should use a spreadsheet or csv for ease of editing by other staff in future.) Every control has a MouseMove event which refers to a function: getStatus(cID) that opens the file, grabs the line and displays it in the status label. It also grabs a few parameters from the same line in the file, such as whether the label is clickable (to link to a page in the help file), and what colour the label should be.
So a few questions really:
Will the application be slow if a userform is constantly referring to a file? It feels fine to me, but I've been in it far too long, and I'm the only user accessing that file. There will be 80 constantly accessing it.
Is MouseMove over a control the best way? Should I instead use co-ordinates?
Most importantly (in terms of me having to do as little work as possible) is there some way to do this so that I do not have to have a MouseMove event on every single control? I have a good few hundred or so controls, each with their own identifier (well, not yet, but they will if this is the only way to do it). Maybe when the form loads I could load ALL the possible status lines so they're ready for whenever the control is moused over. But then, maybe the loading time is negligible?
Appreciate any ideas or thoughts - especially if VBA already has a whole range of functions to do this already and I'm just trying to reinvent the wheel. I can't use the application status bar, because the user rarely sees the application itself.
Thanks!
EDIT:
It is for both data entry, clicking around and a bit of document generation.
It is a controlled environment so macro security issues aren't a big concern for me - and if something goes wrong it's someone else's fault or problem :)
Is this data entry app or do they just click stuff? Because often the field with focus is different to the item the mouse is hovering over, this can cause a lot of confusion.
Constantly reading from a file is a huge waste of time and resources - it is much better to load them only once into an array or collection when the form is loaded.
On MouseMouse event is better than coordinates because you can move things around without worrying. It's a lot of code but you should be able to generate most of that if you have a list of control names because the code should be identical.
ie
Sub Control_MouseMove()
DisplayStatus(Control)
End sub
I would consider the StatusText property and ControlTipText property of controls for this kind of help.
StatusText
This example sets the status bar help text for the form field named "Age."
With ActiveDocument.FormFields("Age")
.OwnStatus = True
.StatusText = "Type your current age."
End With
ControlTipText
This can be assigned from the property sheet for the control.
Private Sub UserForm_Initialize()
MultiPage1.Page1.ControlTipText = "Here in page 1"
MultiPage1.Page2.ControlTipText = "Now in page 2"
CommandButton1.ControlTipText = "And now here's"
CommandButton2.ControlTipText = "a tip from"
CommandButton3.ControlTipText = "your controls!"
End Sub