menampilkan data pada power point menggunakan program visual studio 2010
selamat siang,
apa kabar gan, kali ini saya akan menerangkan bagaimana menampilkan data pada powerpoint(PPT) menggunakan program visual studio 2010,
langsung saja ke pembahasan :
pertama :
buka visual basic 2010 agan, pada menu project => add reference => pilih COM => Microsoft powerpoint 12.0 Object Library dan pilih juga Microsoft Graph 12.0 Object Library
kedua :
langsung ke koding program vb ,
Imports Office = Microsoft.Office.Core
Imports Graph = Microsoft.Office.Interop.Graph
Imports PowerPoint = Microsoft.Office.Interop.PowerPoint
sub pppt()
Dim sTemplate As String = "D:/pppt.pptxs"
Dim oApp As PowerPoint.Application
Dim oPres As PowerPoint.Presentation
Dim oSlide As PowerPoint.Slide
Dim pptShape, montpptshape, montpptshape1, montpptshape2 As PowerPoint.Shape
Dim bAssistantOn As Boolean
oApp = New PowerPoint.Application()
oApp.Visible = True
oApp.WindowState = PowerPoint.PpWindowState.ppWindowMaximized
oPres = oApp.Presentations.Open(sTemplate, , , True)
oSlide = oPres.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutBlank)
oSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle, 0, 0, oPres.PageSetup.SlideWidth / 2, oPres.PageSetup.SlideHeight / 2).TextFrame.TextRange.Text = "Rate NG"
oSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle, oPres.PageSetup.SlideWidth / 2, 0, oPres.PageSetup.SlideWidth / 2, oPres.PageSetup.SlideHeight / 2).TextFrame.TextRange.Text = "Rate Produksi"
oSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle, 0, oPres.PageSetup.SlideHeight / 2, oPres.PageSetup.SlideWidth / 2, oPres.PageSetup.SlideHeight / 2).TextFrame.TextRange.Text = "Rate Data NG"
oSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle, oPres.PageSetup.SlideWidth / 2, oPres.PageSetup.SlideHeight / 2, oPres.PageSetup.SlideWidth / 2, oPres.PageSetup.SlideHeight / 2).TextFrame.TextRange.Text = "Rate Data Claim"
oSlide = Nothing
Dim SlideIdx(1) As Integer
SlideIdx(0) = 1
With oPres.Slides.Range(SlideIdx).SlideShowTransition
.AdvanceOnTime = True
.AdvanceTime = 3
.EntryEffect = PowerPoint.PpEntryEffect.ppEffectBoxOut
End With
Dim oSettings As PowerPoint.SlideShowSettings
oSettings = oPres.SlideShowSettings
oSettings.StartingSlide = 1
oSettings.EndingSlide = 1
bAssistantOn = True
oSettings.Run()
oSettings = Nothing
If bAssistantOn Then
oApp.Assistant.On = True
oApp.Assistant.Visible = True
End If
oPres.Saved = True
oPres.Close()
oPres = Nothing
oApp.Quit()
oApp = Nothing
GC.Collect()
end sub
apa bila keterangannya kurang jelas silahkan isi kolom komentar, terimakasih
apa kabar gan, kali ini saya akan menerangkan bagaimana menampilkan data pada powerpoint(PPT) menggunakan program visual studio 2010,
langsung saja ke pembahasan :
pertama :
buka visual basic 2010 agan, pada menu project => add reference => pilih COM => Microsoft powerpoint 12.0 Object Library dan pilih juga Microsoft Graph 12.0 Object Library
kedua :
langsung ke koding program vb ,
Imports Office = Microsoft.Office.Core
Imports Graph = Microsoft.Office.Interop.Graph
Imports PowerPoint = Microsoft.Office.Interop.PowerPoint
sub pppt()
Dim sTemplate As String = "D:/pppt.pptxs"
Dim oApp As PowerPoint.Application
Dim oPres As PowerPoint.Presentation
Dim oSlide As PowerPoint.Slide
Dim pptShape, montpptshape, montpptshape1, montpptshape2 As PowerPoint.Shape
Dim bAssistantOn As Boolean
oApp = New PowerPoint.Application()
oApp.Visible = True
oApp.WindowState = PowerPoint.PpWindowState.ppWindowMaximized
oPres = oApp.Presentations.Open(sTemplate, , , True)
oSlide = oPres.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutBlank)
oSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle, 0, 0, oPres.PageSetup.SlideWidth / 2, oPres.PageSetup.SlideHeight / 2).TextFrame.TextRange.Text = "Rate NG"
oSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle, oPres.PageSetup.SlideWidth / 2, 0, oPres.PageSetup.SlideWidth / 2, oPres.PageSetup.SlideHeight / 2).TextFrame.TextRange.Text = "Rate Produksi"
oSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle, 0, oPres.PageSetup.SlideHeight / 2, oPres.PageSetup.SlideWidth / 2, oPres.PageSetup.SlideHeight / 2).TextFrame.TextRange.Text = "Rate Data NG"
oSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle, oPres.PageSetup.SlideWidth / 2, oPres.PageSetup.SlideHeight / 2, oPres.PageSetup.SlideWidth / 2, oPres.PageSetup.SlideHeight / 2).TextFrame.TextRange.Text = "Rate Data Claim"
oSlide = Nothing
Dim SlideIdx(1) As Integer
SlideIdx(0) = 1
With oPres.Slides.Range(SlideIdx).SlideShowTransition
.AdvanceOnTime = True
.AdvanceTime = 3
.EntryEffect = PowerPoint.PpEntryEffect.ppEffectBoxOut
End With
Dim oSettings As PowerPoint.SlideShowSettings
oSettings = oPres.SlideShowSettings
oSettings.StartingSlide = 1
oSettings.EndingSlide = 1
bAssistantOn = True
oSettings.Run()
oSettings = Nothing
If bAssistantOn Then
oApp.Assistant.On = True
oApp.Assistant.Visible = True
End If
oPres.Saved = True
oPres.Close()
oPres = Nothing
oApp.Quit()
oApp = Nothing
GC.Collect()
end sub
apa bila keterangannya kurang jelas silahkan isi kolom komentar, terimakasih
Komentar
Posting Komentar