kayaknya itu udah bawaan powerpoint deh. paling kalo mau diakalin, position windows-nya di ubah (pake SetWindowPos(hWnd,Left,Top,Width,Height) di pojok kanan bawah :) Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _ ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
-----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of wedhi2002 Sent: Monday, February 04, 2008 10:36 AM To: [email protected] Subject: [belajar-access] Powerpoint Automation - Set Visible = false Rekan Milis sekalian, Saya sudah membuat fungsi untuk menggabungkan 2 file jpg menjadi 1 file jpg dlm satu halaman A4. Contoh, KTP.Page1.jpg dan KTP.Page2.jpg menjadi KTP.jpg. Kendalanya: Instance App harus visible. Kalo ppApp.visible diset false, langsung error. Ada sharing, gimana mengatasi hal ini? Trims, Edy WIYONO '--------start---------------------- Function JPG2JPG(ByVal file1 As String, ByVal file2 As String, ByVal sFileName As String) On Error GoTo JPGError Dim ppApp As PowerPoint.Application Dim ppPres As PowerPoint.Presentation Dim ppCSlide As PowerPoint.Slide Set ppApp = CreateObject("Powerpoint.Application") Set ppPres = ppApp.Presentations.Add(msoTrue) Set ppCSlide = ppPres.Slides.Add(1, ppLayoutBlank) ppApp.Visible = True With ppApp.ActivePresentation.PageSetup .SlideSize = ppSlideSizeA4Paper .FirstSlideNumber = 1 .SlideOrientation = msoOrientationVertical .NotesOrientation = msoOrientationVertical End With With ppApp.ActiveWindow.Selection.SlideRange.Shapes .AddPicture(file1, msoFalse, msoTrue, 0, 0, 540, 386).Select .AddPicture(file2, msoFalse, msoTrue, 0, 390, 540, 386).Select End With ppPres.SaveAs "C:\Temp\Test1.jpg", ppSaveAsJPG, msoFalse FileCopy "C:\Temp\Test1\Slide1.jpg", sFileName Kill "C:\Temp\Test1\Slide1.jpg" ppPres.Close ppApp.Quit Set ppClide = Nothing Set ppPres = Nothing Set ppApp = Nothing Debug.Print "Success" JPGExit: Exit Function JPGError: Debug.Print Err.Number & vbCrLf & Err.Description Set ppClide = Nothing Set ppPres = Nothing Set ppApp = Nothing Resume JPGExit End Function '---------end-------------

