Merge Two Decks into One in MS PowerPoint 2010 Using PPT.MergeWithBaseline in VB.NET
In this article I am going to explain about how to Merge Two Decks into a single baseline deck in a Microsoft PowerPoint 2010 presentation.
Introduction
In this article I am going to explain about how to Merge Two Decks into a single baseline deck in a Microsoft PowerPoint 2010 presentation. For this we use PPT.MergeWithBaseline, ActivePresentation.InMergeMode in Microsoft PowerPoint 2010.
To run this code you must have three sample presentation name Vipendra, Vipendra1 and vipendra2. In presentation vipendra, create five slides : My Life, My Style, My Rules, Change with the change and Otherwise change will change you. Now save this presentation as Vipendra1 and delete three slides My Life, Change with the change and Otherwise change will change you. After it change Slide My Rules to My Rules vipendra. Now save it and close it. Now again open presentation Vipendra and save it as name vipendra2 and delete slide Otherwise change will change you. Now run this code in Presentation Vipendra2's VBA.
Microsoft Office 2010 offer some powerful tools, using this tools you can create application. Using Microsoft Visual Basic for Applications (VBA) you can create your own application according to your need. These application can performer some specific task.
For creating application we can use
- VBA host of Excel 2010
- VBA host of PowerPoint 2010
- VBA host of Word 2010
NOTE : OneNote 2010 is not a VBA host.
Code that we use in this application are given below
Sub TestMergeWithBaseline()
Const withPresentation As String = "C:\Temp\Vipendra1.pptx"
Const baseLinePresentation As String = "C:\Temp\Vipendra.pptx"
If ActivePresentation.InMergeMode Then
ActivePresentation.EndReview()
Else
ActivePresentation.MergeWithBaseline(withPresentation, baseLinePresentation)
If ActivePresentation.InMergeMode Then
If MsgBox("Accept all changes?", vbOKCancel, "MergeWithBaseline") = vbOK Then
ActivePresentation.AcceptAll()
Else
ActivePresentation.RejectAll()
End If
End If
End If
End Sub
Steps for Creating Application
Step 1 : Start Microsoft PowerPoint 2010 :
Step 2 : Create a Presentation Vipendra with five slides : My Life, My Style, My Rules, Change with the change and Otherwise change will change you.
Step 3 : Now save this presentation as Vipendra1 and delete three slides My Life, Change with the change and Otherwise change will change you. After it change Slide My Rules to My Rules vipendra.
Step 4 : Now again open presentation Vipendra and save it as name vipendra2 and delete slide Otherwise change will change you.
Step 5 : Using Alt + F11 Key Start Visual Basic for Applications (VBA) Window :
Step 6 : Select on VBAProject(Presentation 1) :
Step 7 : Right Click On VBAProject(Presentation 1) ==> Goto Insert==> Goto Module & click on Module:
Step 8 : Write Code in Visual Basic for Applications (VBA) Window :
Step 9 : Run Application using F8 :
Step 10 : Macros window will open, Select Macros name and click on Run Button :
Step 11 : Output of Application : When we try to run this code it create some changes in presentation but before implement changes in presentation it ask to implement changes in presentation.
Step 12: Now It shows some changes in presentation as show option in slide1 and slide 4 for delete it. We delete slide 1 using this option and it also show some more option in last slide and in right side.
Step 13 : Now when we again press F8 in VBA it merge presentation Vipendra in presentation Vipendra2
Step 14 : Now when we again press F8 in VBA it merge presentation Vipendra1 in presentation Vipendra2