|
Prev: how do i insert a java applet into powerpoint
Next: How do I insert media into power point when it comes up with: can.
From: Abhishek on 17 Feb 2005 04:49 Hi! Can i get to know the original image format of the image presently inserted on the slide. e.g I insert a Png image and a jpeg image and say a bmp. Now can i get to know which type of image this was thru VBA so that when i am exporting this image i am able to export it in the same format. Regards, Abhishek
From: Shyam Pillai on 17 Feb 2005 05:18 No, PPT does it's own bit of conversion on certain file types once it is embedded. You cannot do it with VBA. You can parse the information from the html though. -- Regards, Shyam Pillai http://skp.mvps.org/ "Abhishek" <abhishek(a)alwayshelpful.com> wrote in message news:O3v1yUNFFHA.3120(a)TK2MSFTNGP12.phx.gbl... > Hi! > Can i get to know the original image format of the image presently > inserted > on the slide. > e.g I insert a Png image and a jpeg image and say a bmp. > Now can i get to know which type of image this was thru VBA so that when i > am exporting this image i am able to export it in the same format. > > Regards, > Abhishek > >
From: Abhishek on 17 Feb 2005 05:28 Abhishek SignatureAbhishek Bagga Intellimind Systems Pvt. Ltd. www.sikhya.com (+919815005578 "Shyam Pillai" <msgbox(a)gmail.com> wrote in message news:uv2QQoNFFHA.1260(a)TK2MSFTNGP12.phx.gbl... > No, PPT does it's own bit of conversion on certain file types once it is > embedded. You cannot do it with VBA. You can parse the information from the > html though. > Howz that possible. Where is the info stored in HTML ? Abhishek
From: Shyam Pillai on 17 Feb 2005 05:51
Press Alt+Shift+F11 to launch the script editor. Look thru the html that is generated for the relevant information. Once you know what to look for you can pull the entire html into a string variable by using the HTML Project object associated with the presentation and then parse it. This is a hack which works on 2000+ versions and requires installation of the Microsoft Script editor. ' ----- Beginning Of Code ----- Option Explicit Sub Test() Dim sExt As String Dim oShp As Shape Set oShp = ActiveWindow.Selection.ShapeRange(1) sExt = GetImageExtension(oShp) MsgBox sExt End Sub Function GetImageExtension(oCheckCopy As Object) On Error GoTo ExitImageExtensionError Dim oTmpPPT As Object Dim sHTMLString As String Dim sBuff As String oCheckCopy.Copy Set oTmpPPT = Presentations.Add(False) With oTmpPPT.Slides.Add(1, ppLayoutBlank) .Shapes.Paste End With sHTMLString = oTmpPPT.HTMLProject.HTMLProjectItems("Slide1").Text If InStr(1, sHTMLString, "<v:imagedata src=" & Chr(34)) <> 0 Then sBuff = Mid(sHTMLString, _ InStr(1, sHTMLString, "v:imagedata src=" & Chr(34)) _ + Len("v:imagedata src=") + 1) sBuff = Left(sBuff, InStr(1, sBuff, Chr(34)) - 1) sBuff = Mid(sBuff, InStrRev(sBuff, ".") + 1) End If ExitImageExtensionError: GetImageExtension = sBuff oTmpPPT.Close Set oTmpPPT = Nothing End Function ' ----- End Of Code ----- -- Regards, Shyam Pillai Toolbox: http://skp.mvps.org/toolbox "Abhishek" <abhishek(a)alwayshelpful.com> wrote in message news:OdPqlqNFFHA.2876(a)TK2MSFTNGP12.phx.gbl... > > Abhishek SignatureAbhishek Bagga Intellimind Systems Pvt. Ltd. > www.sikhya.com (+919815005578 > "Shyam Pillai" <msgbox(a)gmail.com> wrote in message > news:uv2QQoNFFHA.1260(a)TK2MSFTNGP12.phx.gbl... >> No, PPT does it's own bit of conversion on certain file types once it is >> embedded. You cannot do it with VBA. You can parse the information from > the >> html though. >> > Howz that possible. > Where is the info stored in HTML ? > > Abhishek > > |