PowerPoint Automation using VBA. Complete professional course for free

PowerPoint Automation using VBA. Complete professional course for free

SUBTITLE'S INFO:

Language: English

Type: Robot

Number of phrases: 1421

Number of words: 7975

Number of symbols: 31406

DOWNLOAD SUBTITLES:

DOWNLOAD AUDIO AND VIDEO:

SUBTITLES:

Subtitles generated by robot
00:00
hey guys welcome back to my channel i'm lumpamai and in this series i'll guide you in detail on how to use vba to work with powerpoint post completion of this course you should be able to understand and work with all major components within powerpoint extend or develop solutions for powerpoint and also learn how to integrate with other applications like excel these are the high level points that i'll be covering today as we dive in i'll be sharing more tips and tricks and work around for issues you might
00:32
encounter we'll first start off with working with objects and then we'll move on to the rest of the topic we do have a lot but i'll try to cover you know like all the important aspects and i'll try not to go too fast in the first part we'll basically learn how to refer to these objects um you know like the application itself the presentation uh slide shapes and how to control them write to them read uh and so on and then i'll you know like leave some tips and tricks in between if
01:03
you miss or two prior videos um it's okay i'll try and cover all those parts again but um we'll redo a little bit of this as well at later stage but once you learn how to you know like control these objects it should not be difficult as for the rest of the topic so let's start off um by adding f new powerpoint i'll just add a blank powerpoint here um so very quick recap
01:33
on the hierarchy so first is the application itself which is the powerpoint and then um the presentation which is uh this yeah and then we have slides which we can add you know like more slides um and then within the slides you can add shapes and different type of objects uh images icons and so on and then you can also add tags and add animation and so on so we'll cover all this uh first of all let me just get rid of all this
02:04
and let me save this as micro enabled so that we can have a backup of the code um or point vba let me just name like this we're going to visual basic editor uh if anyone is very new uh just customize your ribbon if you don't see the developer tab just check this button okay there is no micro recording so um you know we'll have to refer to these objects using the enumerations so all f11 insert a module will cover
02:37
the user form class at a later point okay so um there are multiple ways to refer to these objects um so we'll start get started with uh presentation um vba um so first will be presentation let's declare presentation as presentation pra pre and then um we'll have to like any other uh objects we'll have to set set objects okay
03:11
and this could be active presentation which is the current powerpoint uh file yeah and then we can do this um we'll just clear the object from the memory if i f8 debug this maybe we can try and print this let's see write a quick function to print this message as string then debug.print
03:48
yeah so every time we don't have to write debug.print we can see in our presentation.full name so it prints out the full name yeah here's memory now um you can also add a presentation instead of this you can simply um set presentation equal to presentation dot and that will add a brand new uh presentation just disable printing here and just add a new presentation and
04:22
um here you can start referring to you know like uh the slides and you know adding manipulating stuff uh one more way you can also open presentation so [Music] will be presentation instead of add will use the open method and here uh basically let's say that um i'll just add a slide here like this and save us in the same location
04:56
let's go to the sample file and then if i go here now and get this spot so we can open this part you can specify read only or you know you can open right mod as well if you have to edit you have to open set this to false okay now we can um maybe print out this file name again yeah so it prints this file name now oh you can maybe you want to close uh save it and
05:40
close was editing the file or something so this is how you can do it all right run it um just give me once again i think the other file will open earlier if i run this again think this is read only let me see if i what if i open this manually let me make sure all the files are closed okay let me try again read only
06:32
false now it's opening up in red only false and i'm able to save it close it and clear the memory okay so that will be pretty much how to refer to the file itself um and you can save us we already covered like how to save this um export as a fixed format uh like um oh sorry uh first uh in case you want to save us instead of save
07:04
you can do this save as and here you can specify the file name um so let's say that we want to save in the same path let's print this part dot part active presentation part so we can build pod around this save as in the same path and then we will just put flash save as demo2 dot either you can put a file extension here
07:53
directly or you can also use um this animation like uh pp uh save as uh presentation okay that will be just ppt you can also use um micro enabled uh let me just give it a quick demo for that as well i'm just gonna run this so i go here you can see this demo to save now if i want to just not specify this and i'll say demo tree
08:28
dot macro enable pptm yeah if i run this also that also works or you can also just do save save as um save as open xml macro enabled i think this is yeah let's try this demo for okay so i'll leave the link in the video description for all this uh options or you can also press f5 you know f2 and look at the browser as
09:14
well so this way you can also save us a different format okay in the presentation slideshow and all this um and finally if you have to export it as um fixed format you can also export it as a pdf file this in using this method uh so let's say that uh we'll use this same part and then instead of this we'll say on demo five
09:45
dot pdf and here you can specify to or you um we can use um fixed format df okay um or you can simply type two so in case you're not familiar with this you can press f2 okay and search for this and when you get ahold of this particular form uh you know a member you see that you can use instead
10:21
of the full name you can just use a number yeah f7 to go back and so you can run this let me first run this [Music] there's no destruction let me put something first maybe something like this um okay this is the one uh simple file so let me first add something really quick something like this okay so that we can
11:02
do a demo just open this file and export it as a pdf uh you can also do this yeah so here's a pdf yeah um yeah that will be pretty much from the uh presentation uh file itself um and then now we can proceed further to the slides and uh to how to refer to them now let's call this slide demo um so you can directly add slide to active
11:37
presentation or you can set up in this fashion yeah and then you can add a post within this area is where you can start adding slides and doing stuff now um let's say that we want to add a slide let's say we variable slide as a slide and then always set for objects you said the slides dot add um here uh you can specify
12:14
um the index where you want to add if you want to add in the end then you have to specify the last slide count plus one yeah but for now let me add this to the top and then you can specify the layout for example we already talked about this format similarly you can find out um layout title only and then we'll just clear this from the memory uh let me close this
12:54
yeah so you just added a slide now if you want to add a slide to the bottom just let me put something so you know what these are existing ones yeah so if you want to add to the bottom then you'll have to simply get the count of all the slides uh that will be presentation slice.com here so plus one
13:24
dot slides dot count okay so if i run this now just edit this slide here yeah um what more can we talk about here before we start talking about how to refer to them uh you can also apply the um the format after you edit it so for example this dot dot layout go to and you can specify any of these
13:58
layouts after you created them as well so uh powerpoint layout title maybe table something like that if i run this now yeah it created this and then it applied the table layout so that's basically how to add the slide um referring to slides there are a couple of ways to refer to slides by id you can also refer to it by name by the index so uh let's give them all for that as
14:37
well uh you can also say like this okay and then uh so let's say that we want to navigate to the second slide you can do it this fashion dot select see if i run this now selected that yeah you can also that is by the index you can also for example look through all the slides
15:16
dmv slider slides [Music] let's look through all the slides and now we can debug the [Music] name and just to give what are the options you have and we slide dot slide id and
16:09
slide index maybe instead of a comma i'll just put operator of this so these are the name of the slides at the moment and this is the the slide id and this is the index so you can refer to the slide by this uh you know like these options okay um so if i have to demonstrate this now so first let's find by the id i'll also show you how to name the id uh the slides uh activepresentation.um
16:57
line slides let's select id and let's say now we want to go to the forge so we know the fourth one slide id is this yeah so you can specify this in this question and if i run this now it should go to uh 259 is the fourth yeah it's one to default so this way you can refer to it and then within the slide you can do a certain thing you know um okay to name it here normally you don't see the slides
17:34
so one way to go about it is um sometimes there is an option to view the name as well here but normally um sometime i don't see it i'm not sure why um yep so if you know and please let me know um so normally what i do if you have to find a name i normally just add any of the activex control here any of anywhere within the slide once i double click it then you're
18:06
able to see the name of the slide which you can press f4 and rename it as well by yourself um view um properties let me save it first yeah so you can rename this slide to anything so let's say this is um slide 3x okay and if i go back to my code instead of finding by id now we can find by the title itself
18:42
me comment this out um slides and then here is expecting the index but let me put the name and see if it works so if i go and activate this and i expect this to go to slide uh 3 8 yeah so it went there okay earlier it was here i run this again yeah it went here so this is how you can refer uh to add a name if you already know the name of the slide and you want to
19:13
dot name you can change this [Music] change instead of x i'll make it that and let me rerun this and here we should be able to see it reflect once we go back yeah so the name have changed you can also if you know the the index for example um this dot this dot name is equal to
20:02
slide one so you can also specify the name i'll rename the slide in this fashion so if i rerun this loop it will have the slight name change yeah so if i do slide two you'll see that this slide name will get changed um if i rerun this now and loop yeah so you can see it have changed again okay so that's how you can rename you can refer to the slide by
20:33
the slide id by index um you can add the slide uh refer to them okay so you can move around the powerpoint uh that way with two points more to add here well we are in the slide topic uh if you want to export the current sliders image we did that space uh in our other video which is you know i just export but very quickly you can once you have the slide set up for example this is slide
21:07
um let's say we want to export this slide here this one so we can say slide we'll just refer to it by index and then you can especially do slide dot export and then in the export you can simply first will be the name of the image you want to export and then here um you can specify uh the type for example like jpg yeah and then here you can specify the
21:41
pixels like how uh the weight and the height yeah so normally for um for youtube thumbnails i use uh 4000 and then the the height i use it two two five zero yeah so if i run this now let's take the part from up here jpg and let's call this
22:18
image exported so we are expecting to export this particular slide let me just put a color differentiation yeah okay let me run this now folder so here's the image that got exported yeah oh i put one so that will be the first one if i redo this quickly for two yeah okay and one last thing to add if
23:03
you want to navigate instead of select you can also use go to so this will be my uh dot down let me just get rid of everything [Music] if you want to navigate to a slide uh there's another way so active window we'll talk about this in a bit as well dot view um dot go to slide and here you can specify the index uh
23:47
or you can reconstruct the name by the id as well yeah so if i want to go to slide two you can also specify in this version yeah if i put it to four okay now let me show you some examples on slide uh shapes as well let's do this i'll just put a number there just to differentiate that demos so let's say that uh
24:22
we want to work with slide three and we want to add um shape here um you can add multiple i mean pretty much all the shapes that is there um so current this particular slide dot uh shapes dot add here uh add shape sorry and then here you can specify all this uh are your options okay so let's say we want to uh hard
24:53
yeah and then you can specify for example left right the positions that we talked about in our prior video but basically um this particular uh all the you know positions okay um first let me declare shape and then we will set the shape equal to this so if i run this now we expect the shape to be added with this particular width height uh top and all this yeah so very quickly left and then top uh position
25:28
and then height and width yeah run this now um yeah so hard is added now we can do a similar example here for example let's say we want to do a rectangle yeah so one more heart shape yeah um you might want to add text as well i'll just reuse this you can specify uh shapes dot sorry
26:08
add text box and then within this you can specify um the type right so let's say we want to do uh mso text orientation horizontal yeah and here you can do the same thing and the right to the particular you know like shape you can use this okay so quickly you have this text frame and then text range okay next
26:41
frame dot x range dot text is equal to and maybe we can see so if we run this now i'll just comment this out for now f8 so hello yeah uh if you already know the shape for example um this one title one right so let's try this [Music] let me just comment this all so that can
27:37
refer to it later so instead of um like we did for the slide we can also do in this fashion i guess i remember [Music] correctly [Music] yeah so you can also refer to it by name by index as well yeah um so that's how you refer to the shapes you can add the shape all
28:27
different types of shapes now quickly in case you want to um export let's say you want to export this slide now we talk about the slide the shapes let's say you want to export the this particular slice from one powerpoint to another let me give a quick demonstration so going back here just copy this let's call this export to another ppt um
29:06
so let's say that we want to export from current powerpoint two slides um so i'll say that uh dim presentation equal to this active presentation and then we uh the presentation let's call this destination or point or target uh we'll open this powerpoint and we'll export it here okay
29:45
now um let me just do this let's not close this and we'll leave it here so we can see the results um and now we already know how to refer to the slides so we can say let's try with one slide first [Music] um so slide 2 and we can do slide 2 dot
30:34
copy and then um okay so let's try this um and so it opened the presentation uh now it said the slide to this you know like our presentation slide number two it's gonna copy it's gonna paste it here now okay so this is how you can basically uh do it uh as far as referring to the slide you can also refer again to by using the
31:13
uh find method as well that we covered here where is that yeah find my slide id so that's all you can also find okay and then uh you can copy and paste you can set up if you have to do this from multiple of them you can set up an array um and then you can look through the array and copy and paste it in this fashion okay so here we are copying the slide and pasting it to the destination as far as saving as we already covered here how to save us into a different powerpoint okay so this will be helpful when you
31:56
have to do like um consolidating uh different slides from multiple powerpoints now let's quickly touch base on the animation so let's say that we have these three shapes um maybe another shape another type of shape something like that and let's see that we have um animation let's say fade in um let me go do this
32:31
and then this one further okay so this is a basic animation that will pop up one after another um let's say that we want to you see this duration and if you have to manipulate this animation um sequences then uh you can also do that let me quickly demonstrate that um now so let's see so uh will take care of trigger
33:11
delay timeline delay etc and now let's say that you want to look through all the time sequence in the timeline of the current slide and then we will increase or decrease or delete the animation we can just get this our slide is trace so i'll just say tray um so with this particular slide um
33:48
we want to loop true so let me just put index here y is equal to um this slide dot time [Music] timeline.mainsequence.com so this will return us one of the sequence uh [Music] so from the bottom to the top and step minus one and here we can set up uh we can refer to
34:30
the effect now let's see that on effect as okay and then we can set it here v slide dot uh timeline the sequence and here we can specify our i as the index um [Music] now if you have to delete you can just specify delete here which will delete the sequence let me first
35:07
set the maybe we can set dot timing dot trigger delay time so if we go back here so one is the delay time and one is the duration right so let's say delay time is equal to delay time plus maybe 0.00 something like that um we'll just increase
35:43
like that okay now if you observe here you'll see that it will increase yeah as you can see here this happened okay uh if i rerun this now yeah a little bit now if you want to uh decrease uh uh yeah then you can do a reverse of this okay um let me do it reduce it further down okay it's not going any further down because it's already zero
36:26
[Music] run this yeah a bit faster uh again if you have to delete then you can just use this okay so now it's deleted the animation is gone uh in this part let me quickly demonstrate how to insert icons or the image to your slide this will become handy later on when we do the uh we'll use this particular function okay so it's it's a single line a small method so let's call this
37:02
um [Music] function at um or let's say insert image and then file variable file or p file a string okay and this will return true or false uh for this we'll use again active window and then dot selection wherever the selection is
37:41
slide range dot um shapes dot add image add picture and here we'll take in rp file and then um what is this link to file so this could be ammo's [Music] false and next see if we document this part
38:18
save with document yeah we'll do this as well as uh if you want to save along with the document and we want that to be true and then you can specify left um and top so let's say we want to insert it maybe 100 and top as well as hundred uh the width and the height is optional now let's say we want to specify 40 40 each and then dot select okay so that is
38:50
pretty much it that will be our function to insert the image now we can try and test this out and let me take this part okay so it's inserted done here one more image uh let's see this is the one we can also add a quick handler here um like uh p top as long so that it does not insert
39:52
in the same area all the time yeah so b top and p left um we can insert it here so every time it's inserted we can increment it by something like p top plus 50 and then is plus 50 and this will be left and top okay let's try again and a quick handler here to reset
40:43
um so one way to identify here the left and the the top what will be the maximum you can you know i get a shape like this and we can reuse the method that we wrote sometime back here um shapes by title yeah um so this particular my three shapes will be this will get the left and the top
41:40
[Music] okay so it's about 900 if the shape is this small the shape is bigger it's around 800 and the top is about 400 yeah so we can reset um in this fashion so if top is greater than or equal to maybe um around 500 then we can reset here
42:11
similarly if the top i'm in the left be left is greater than or equal to [Music] 700 then we want to reset the left back to 10 or something and if the top is this then we'll reset back to maybe just below the title and for the left we want to kind of
42:47
because it will be standing like this we just wanted to last maybe 350 300 maybe let's give this a try um let's reset this first v top equal to zero be left just resetting it okay okay so that should that should be okay based on your image you can add more dynamics to the code like this okay that will be pretty much for working
43:28
with objects but if you do have any questions uh please do comment and i'll try to come back as soon as possible now let's take a look at various ways to call or trigger this program that you'll write in your powerpoint present okay so if you're like uh just wanting to do this for yourself really quick um one way would be to go to your ribbon uh let me just do this let's say that we want to run this code
44:00
yeah so uh we you can add a button here really quickly or you can create your uh group here itself so go to your ribbon and one way would be to go here um your micros and these are all the macros that you have written so we can you know i simply um in any of these tabs you can add actually so let's say we want to add it to a group here let me add a custom group we'll rename
44:33
it as custom and within this we can move this code um you can rename it you can put in some you know uh i can do this maybe something like this so now we should have uh yeah if you click here then it should insert you know all these icons here ctrl z okay so that's quick but uh you will not
45:07
be able to share this uh file uh it'll not uh the customization will not cannot be shared so you'll have to do a ribbon x for that which i'll cover in a bit another way will be um culling through uh maybe shapes so if you have a shape like this you can also assign a code so normally like in excel we do have an option right click and assign a micro but in powerpoint the way to go about will be go to insert action and here you can even initialize
45:39
the program or you can run existing macro so for example this micro if you want to run if i bring this up i should be able to call that macro the thing is that in the slideshow mode we are not able to do that let me quickly demonstrate by test micro let's assign this new micro
46:14
[Music] yeah so the code is called so if you want to make your slides interactive this will be one way to move around things and add animation on runtime and so on for the context menu uh we can just reuse the episode 2 of custom menu ribbon x series okay uh you can actually drag between these projects as well where is so if you have uh your excel
46:52
picture as well so you can simply drag and drop it here like this yeah the only thing is uh it will not understand this workbook worksheet and all this so the menu worksheet menu bar will become just menu blur um [Music] this workbook will become active presentation or we can even specify the name of this particular um presentation
47:27
[Music] activepresentation.name so if we are referring to the code in this file we can specify like this this is what name okay so let me try to run this if it works well it should show up a menu uh in add-in step so here is the menu we just added okay
48:07
so you can replicate this as well if you have not seen this episode i'll leave link in the video description uh you can rename all these uh labels in a way you want um maybe import from you know like import icon images and so on you can build your own custom menu based on the utilities or customization that you build into your present um yeah so that will be pretty much it
48:38
this is the caption for um the sub menu and these are the sub items you can further add sub items to those so we have done a detailed uh tutorial on this so please do check it out i'll leave the link in the video description okay so another way to trigger the code basically what i'm getting at is you can also add a menu like this and then you can call the code so if i go back here and get the test macro and then i'll see that when i click import
49:08
and then i'll say best micro and here i'll specify the code let me delete this now it's deleted i'll re-add it back yeah now if i run this this macro yeah so that's how you can also trigger now if you need you can also add these activex controls uh for example here is the button uh like you normally would use so if you double click it will take you to the
49:42
back of your code and here you can simply uh add your code or you can call other codes from here yeah for example if i load this up now it should run in this question as well you can edit anywhere um and [Music] so you can add a navigation and so on and you can also use text box combo box all this as well um let me just quickly show you i was just playing around with
50:17
this so for example you can add a design you know like this a text box which looks like this or like this uh here's another example maybe here we can add a menu i don't foresee anyone creating a user interface here but uh if you need to create something which is interactive you do in like based on the user input you want to do something you can also utilize this you can simply drag and drop the way i did this was um basically i dropped in a shape
50:46
like this yeah and then um on top of that i added a text like this on top of this so maybe um address something like that and then um the background of this shape was changed to this like this basically and then within this uh after adding a text box like this i added a text box in this version you can bring up the
51:16
properties and then you can change the effect in this fashion okay and then on run time or here as well you can change the back color you know why you want you have more options using rgb from the micro something like that yeah okay um so that's that another example um the activex controls are always on top of the other object so you need
51:49
to watch out for that as well um and then yes you can call the micro it can add you know like drop down on runtime as well the way i did this one was i added um label first like this and then i added a text box inside the label like this and then change the sun the effect to flat and i remove the borders basically
52:20
and then the labels caption is removed and i got i arrived at this yeah so that was me playing around um you can definitely use that in the same way you will use the combo box or any other activex control in other applications so you'll use that if you have not seen our ui ux videos you can definitely check it out it has everything in detail so please do check it out as well
52:50
and let's go back and check the for the user form uh this part i will cover in a bit while we wind up as well we already covered all this part copy slides from one to another import uh powerpoint data uh import to powerpoint from excel this also i can quickly toss base it will not take time now very quickly on the what is this user phone
53:24
context menu we've done so on the user phone is going back here um this user form is from the ui ux series episode one so um you can simply drag and drop those user from that you created in other excel application or you know like in the world for example uh you can drag it into your project like this uh okay and then you can simply uh launch this this one has some excel configs so we
53:53
can just remove that as well or maybe there is something dependent here [Music] okay let me just fix this now if i run this now it launches click here yeah uh so you can um write a code to something that's two three ui load one then user from one dot show um now we can bring this up maybe using
54:48
this button yeah so you can add this as well to the initialized part now coming to the ribbon x part and then to the add-in um let me quickly highlight some of the things that you can do this is just a demo um but if you are interested then i will leave the xml part for free download okay so this is
55:24
the demo utility that i prepared just for uh to give you some idea uh okay just give me one second i need to bring in so this is um basically a ribbon x customization that i've done here is the labels and this is basically a button that will open up uh youtube page and then these are example of how you can add your icons customized as well as the one that is already here uh this is to remove a button again to
55:59
remove all the animations uh to add delay we all rewrote this code and also to add delay time and to reduce uh this to export as image as video we've done this in our other video so we can just copy and paste the code here export it to pdf we've done that this is um dynamic gallery which is a little bit complex to uh be covering in this video so i'll try and cover this in another video okay so this uh
56:29
dynamically basically uh use the get image event to uh get the image from for example from all the you know like from the folder so if you add more um then it will reflect in the you know in this gallery and then you can use the icon to insert it into your powerpoint for example so it might become handy when you're designing any utilities for
56:58
uh powerpoint and then this is another example of gallery uh again this will be added to for free download so you can simply download and then you can customize in the way you want you can change the image which will be uh there so for example if you go um i hope you remember if you have not followed our ribbon x series please do uh check it out so if i open up this
57:31
file now utilities so you'll need to first import all your image here and then for example um all this image you need to change the name of your image in the way you want so if you have not referred to ribbon x series uh please do check it out um yep and i will yes upload this xml so that you can customize in the way you want for your powerpoint um and then these are basic icons which
58:09
you click and then you can um you can call your codes based on whatever you click here okay so that's also uh the same way that you do in your excel or in your word or you know other application you'll do in the same fashion so if you have not seen ribbon x series it's very simple you can just import this customization and then you can trigger your code in in the way you want okay so this is one small example um the the code here will include uh
58:40
you know like how to uh implement to get the value from this um edit box as well okay so do check it out one another static gallery here is the one for image browser so if you want you can also download this uh i'll leave the link in the video description um it's already there in the blog uh available for download okay coming to the last part of this series i'll now demonstrate how to create an add-in also deploy an add-in and a couple of
59:12
ways on how you can trigger the code automatically when the file loads because as i mentioned um in the beginning that powerpoint does not have this powerpoint object so um you know you will not be able to initialize like uh this workbook underscore open even is not available in similarly so uh there are a couple of ways to do this um one way would be to use auto open
59:44
which everyone is familiar but uh this part uh will not work uh if it is not an add-in okay so for example let's say that's a um auto underscore open yeah and here whatever um code that you put in it's gonna uh fire when it when the powerpoint opens up but again this will not work in a normal file uh it only works in file okay so let me close this
01:00:16
and try and reopen this yeah so it didn't fire okay but as soon as you save as an add-in file then that code is gonna fire so that is one way to do it i'll demonstrate that once we uh create an add-in the other way will be to um one is to create a class and also briefly cover that we already did a lot of example in excel so we can do the similar stuff here otherwise will be to create a
01:00:50
custom ui so for example if we open the file this file and we can just get uh any code actually from our ribbon x series i'll just paste it here okay now the only thing you need to add here is uh basically uh unload and then you need to specify what needs to be loaded so for example uh on load and then is equal to
01:01:29
and then here you can specify the kodi one uh the micro name so driven x maybe initialize or something like that okay and then let's get a code for this callbacks okay so here is the customization i just added uh for the buttons and we can now add a ribbon driven x copy this so now whatever code you add here will run irrespective
01:02:28
if it is added or not okay so for example message box [Music] so let me close this okay so that's the way to trigger the code automatically when the code runs in case you do not need any customization you can simply remove them or put in the hidden tab uh group okay um [Music] now let's uh
01:03:08
create an add-in uh to create an add-in you can simply save as and then select the add-in after all your customization is done um so this is for 2003 version and then this is for the latest versions okay so let's go ahead and save this now keep a track of this um your add-in folder just where it's getting saved now let me just call this ppt bpa
01:03:40
this file um okay there was uh the issue was with the activex controls in the so let me just create another version and i'll get rid of all these steps which is uh activex uh this is okay let's create a new slide okay so now that's gone let's try and save it again um okay so now it's saved uh let me close this
01:04:45
so that's the way to create an add-in um whatever you create uh will be saved here so this is the powerpoint we just uh add and we created now to deploy or to install the add-in you simply open uh powerpoint go here uh not this okay this one powerpoint items from here you can add new and select the adding that you created now if you create a new add-in you replace this one in the in the same location okay so if you add this
01:05:18
um to other location it's not going to get loaded so put it in the add-ins folder it's a little bit different than excel as you can see now the auto load also fired and driven x also fired so these are the ones customization we added now let me just start up powerpoint both of them was executed and you can see the customization we added
01:05:47
so that's the way to um to add um to create an add-in and deploy as well okay and um as you can see you will not be able to view the projects that is published in powerpoint okay but um that is not a way to secure your you know vba projects because the user can still have access to the file i'll give a small class demonstration as well in case you're not familiar with class objects um you can use class to extend your you know like
01:06:18
object handling uh events as well especially in powerpoint since we don't have this workbook and and uh objects where you can put in the events you can use class to do that sort of thing so for example i'll call this as um c app application something like that and then here we will add um let's call this private uh with events as application that will be powerpoint application and then once you select the app you
01:06:56
have all the events associated with the powerpoint app class application class and you can use any of these events but you'll have to initialize the class okay so for that um first i'll say set um this app [Music] equal to application and in the load uh whatever whatever load initialization
01:07:29
that you use you can um you know like hook it okay so for example private um let's say ppt application we'll call this as c app question map and then um when this is fired up we'll say that this equal to new like this okay so now this this is uh this part
01:08:01
will get any slice no this part uh class can start working so within this you can choose any um of the events so let's say that you want to select um whenever any other powerpoint presentation is open you want to fire then you can say after after is open or we can also use whenever there's a new presentation it's created if you want to run then you'll use this when the presentation
01:08:34
closed if you want to fire automatically when it is activated when the slideshow begin so all these are things you can use window selection change um so let's try one of them presentation open let's try this so when this uh is um event is fired let's say that we want to call um that's called this program and here in the module i'll just add
01:09:16
[Music] this okay now for this to work we'll have to restart so that this can be initialized okay now uh the event should be working if i add open a new presentation yeah so this program got fired okay so that's a way to um incorporate class into your uh
01:09:58
powerpoint project um similarly you can have uh more objects added uh maybe here as well or in the different uh class object okay so guys i think we have covered pretty much everything i'll leave the link and other related materials further reading there are some documentation official documentation as well available so you can check those as well but i hope all this um demonstration or some of the things we did has helped you
01:10:30
uh if so do not forget to leave a like and i really appreciate if you can share the videos as well so that it will reach out to more people and please do leave a like it will help in the algorithms and i'll talk to you guys in our next video thank you so much for watching have a great day bye

DOWNLOAD SUBTITLES: