Export Video from powerpoint using VBA - vba

I want to export a video from powerpoint using VBA. This video was uploaded from the PC and not using links. I saw that this is possible for the images using this line of code:
ActivePresentation.Slides(1).Shapes(1).Export "C:\Cover.PNG", ppShapeFormatPNG
but I couldn't do the same for videos.

Do you simply need to extract the original video from the PPTX file? If so, rename the file to give it a .ZIP extension, open the zip file, browse for the media folder and in it, you'll find copies of any inserted (but not linked) sounds, videos and pictures.
If you have routines for working with ZIP files in VBA, you could probably work out how to do the same thing.
A possible alternative: size the video to fill the slide, then use PPT's SaveAs method to save as a WMV.

Related

How to bundle my own images and call from function

I have built several custom add-ins for Powerpoint. I integrated them into PPT using Custom UI Editor for Office.
As part of this process, I could make my own icons for buttons, simply by 'Inserting' my own .png files into the PPT (presumably somewhere in the backend, if I were to unbundle the .zip. file which every PPT actually is.
Now, I want to create a button that allows users to easily insert country flag icons, which I can obtain in .svg format. How can I bundle these .svg or .png files into PPT, and call them from a module?
(I don't think it's the calling from module I have trouble with - I just don't know how to bundle the image files into the PPT.)
[EDIT] Alternatively, what I'm asking is this: How can I create an 'Insert Icons' interface that looks like what you get from Insert >> Icons?
(update: John Korchok's answer has made clear this is not possible)
[EDIT2] If you rename your powerpoint from .pptm to .zip```, you can see a folder inside the Zip file called ```ppt. Inside it, you get these folders:
Inside the media folder are EMF and WMF files created from pictures that were inserted into PPT (through the normal Insert Image function, or a simple Copy and Paste).
Is there a way I can write a function that calls images from within this folder?
There's no part of an Add-in where you might be able to store external files. I add a folder of images in the Add-ins folder, then create an installer that places the Add-in and folder in the correct locations.
You can also place the images on a web server and get PowerPoint to download them through VBA. Of course, you'll need a fast connection. The syntax looks like this:
Dim oPicture As Shape
Set oPicture = ActivePresentation.Slides(1).Shapes.AddPicture("http://www.brandwares.com/images/iconfile.png", False, True, 0, 0, -1, -1)

How do I randomly pick an icon for a pen drive?

I've seen a tutorial online that explained how to change the icon of a pen drive once inserted using an autorun.inf file and a .ico file, and it worked perfectly, but I wanted to know if there's a way to choose a random file from a list of .ico files inside the pen drive.
Here's the code I'm using for the normal icon
[Autorun]
Icon=IconName.ico
Label=PENDRIVE
If this can't be directly done using the autorun.inf file, please let me know an alternative method, even if it requires other files (such as .vbs files)
Here's the website I used just in case
https://www.windowscentral.com/how-set-custom-icon-removable-drive-windows-10

Illustrator/PS images when sending to another computer?

I'm not sure how Photoshop works but when I receive an AI file from another computer I get an error regarding the images:
'Could not find the link file 'exampleimage.jpg'.
So I'm guessing the other person would have to send me the images separately?
Is this how Illustrator works?
I'm sure for Photoshop you don't have to do this?
Any info would be helpful.
Cheers
In Illustrator, if you go to menu File/Place, this will allow you to place other art files directly into your open illustrator document. If someone gives you that illustrator file and they do not give the "placed" files as well, when you open the illustrator document it will give you that error message because it cannot locate those files that were placed.
While using the "place" command in Illustrator, if the "link" check box is selected, anytime a placed file into illustrator gets edited and saved outside of illustrator, the edits made to that placed file will update the changes in Adobe Illustrator.
If the photos in their document are not embedded, you will need the images separately. Once you have the images, when you open the file on the new computer, you may need to manually associate the photos with each placeholder to make sure it renders properly.

Open a .pdf file

I am trying to open a .pdf file within Excel like an iframe in HTML.
My requirement is:
Save the path of multiple PDF files in Excel.
Excel should open each .pdf file within Excel itself (no need to open that in a separate .pdf window).
It should be like iframe in HTML. The user should be able
to view the .pdf within Excel itself.
I know this is little weird, but can anybody help me?
you could probably get the filenames via vba.
here's some that claim to work:
Loop through files in a folder using VBA?
So far as opening a pdf in excel - thats kinda pushing it.
Since your request is exotic I can think of an exotic workaround:
If you can spare the interactivity you can simply make copies and convert your pdfs to word formats to work with them and load them in that way. I've seen people convert pdfs to Jpgs just to load them in some other documents but thats rudimentary and really fringe.
Otherwise you are facing a lot of custom coding that needs to make it possible.

Using Office 2007 extension (i.e. docx) for skin based On-Screen keyboard

I'm creating a On-Screen keyboard for my application, and it supports skins as well.
Here's what I'm doing with the skins, I have a folder which contains some images and a xml file which maps the images to the keyboard, I want to be able to have the folder as a zip file like in Office 2007 (.docx) and iPhone firmwares (.ipsw), I know I can simply zip the folder and change the extension, what I need to know is how to read the files in the code.
You've got two options, either 1) just use a zip library like SharpZipLib or DotNetZip or 2) try to use the System.IO.Packaging namespace. I think option 1 would be the easiest probably.
There's nothing really magical that Office and other programs are doing, they're just reading a zip file and pulling stuff out of it as needed. Instead of pulling an image from a disk you just pull it from a MemoryStream.