Hi,
What I'm trying to do is,
once the users select the files they want to merge, they select a button which will:
1. Open an instance of powerpoint
2. Open the first of the files selected by the user
3. Copy/ export that slides from that presentation
4. Paste into the instance of powerpoint (in point 1 above)
5. Close the first file
... repeat these steps for all the rest of the files selected by the user
I know what needs to be done but I have no idea how to go about the syntax in VB/ C#
//I know I need to have the following directive: -
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
-
//Maybe the following: -
PowerPoint.Application oPPT;
-
PowerPoint.Presentations objPresSet;
-
//the location of your powerpoint presentation -
string strPres;
-
strPres = @"mpPres.ppt";
-
But have no idea where to go from here ...
Any help would be very much appreciated ..
Thanks
J
35 13254
Do you really need to do this in .Net? Seems like a PowerPoint macro would be a lot easier. In any case, I would do it as a macro first, because you can record a macro to see how to do it. Then switch back to .Net. That is what I would have to do in order to help you. Try that and post back if you have trouble with anything specific. --Sam
Do you really need to do this in .Net? Seems like a PowerPoint macro would be a lot easier. In any case, I would do it as a macro first, because you can record a macro to see how to do it. Then switch back to .Net. That is what I would have to do in order to help you. Try that and post back if you have trouble with anything specific. --Sam
Hi,
This is the macro that I've created that works: -
Sub Macro6()
-
-
Dim PPApp As PowerPoint.Application
-
Dim PPPres As PowerPoint.Presentation
-
Dim PPSlide As PowerPoint.Slide
-
-
' Create instance of PowerPoint
-
Set PPApp = CreateObject("Powerpoint.Application")
-
-
' Create a presentation
-
Set PPPres = PPApp.Presentations.Add
-
-
-
Dim nSlides As Integer
-
Dim fnames As New Collection
-
fnames.Add "Blah1.ppt"
-
fnames.Add "Blah2.ppt"
-
'fnames.Add "p3.ppt"
-
'fnames.Add "p4.ppt"
-
'fnames.Add "p5.ppt"
-
For Each fnam In fnames
-
nSlides = ActivePresentation.Slides.InsertFromFile(fnam, ActivePresentation.Slides.Count)
-
Next
-
End Sub
-
-
We are geniuses: I've just about finished the same solution in C#. I'll post it when it works. Hope it's not 4:30 AM where you are like it is here! :)
4:30 ... nope its 9:40 ... !! Take it you're an insomniac!!!
4:30 ... nope its 9:40 ... !! Take it you're an insomniac!!!
Well, I'm going back to bed! Here's what I have. I think it would work except for the Type.Missing: can't figure out how to pass a missing Com int parameter: - using System;
-
using System.Collections.Generic;
-
using System.ComponentModel;
-
using System.Data;
-
using System.Drawing;
-
using System.Text;
-
using System.Windows.Forms;
-
using PowerPoint = Microsoft.Office.Interop.PowerPoint; // Add a reference to Microsoft.Office.Interop.PowerPoint.dll
-
using Office = Microsoft.Office.Core; // Add a reference to office.dll
-
namespace PowerPointCombine
-
{
-
public partial class Form1 : Form
-
{
-
public Form1()
-
{
-
InitializeComponent();
-
}
-
private void button1_Click(object sender, EventArgs e)
-
{
-
openFileDialog1.Filter = "Presentations (*.ppt)|*.ppt|All files (*.*)|*.*";
-
openFileDialog1.FilterIndex = 1;
-
openFileDialog1.Multiselect = true;
-
openFileDialog1.Title = "Select Presentations To Merge";
-
openFileDialog1.ShowDialog();
-
// Create an instance of PowerPoint, make it visible, and open a new pres.
-
PowerPoint.ApplicationClass ppApp = new PowerPoint.ApplicationClass();
-
ppApp.Visible = Office.MsoTriState.msoTrue;
-
PowerPoint.Presentations ppSet = ppApp.Presentations;
-
PowerPoint.Presentation ppPres = ppSet.Add(Office.MsoTriState.msoTrue);
-
PowerPoint.Slides ppSlides = ppPres.Slides;
-
foreach (string f in openFileDialog1.FileNames)
-
{
-
ppSlides.InsertFromFile(f, 1, ppSlides.Count, Type.Missing);
-
}
-
ppPres.SaveAs(@"C:\Documents and Settings\Sam\My Documents\Merged.ppt", PowerPoint.PpSaveAsFileType.ppSaveAsPresentation, Office.MsoTriState.msoFalse);
-
ppPres.Close();
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppPres);
-
ppPres = null;
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppSlides);
-
ppSlides = null;
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppSet);
-
ppSet = null;
-
ppApp.Quit();
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppApp);
-
ppApp = null;
-
}
-
}
-
}
BTW, as you can see, you have to be very precise in C#. All of the Office Com stuff is wrapped in what VBA calls a variant which does not fly in C# so you cannot sling stuff together like Application.Presentations.Add.
Manually as in the user will have to open the files???
Not so good then ... wonder if there's another approach???
Manually as in the user will have to open the files???
Not so good then ... wonder if there's another approach???
No, no, not that! We will have to open each presentation in code, copy the slides, switch back to the new presentation, and paste the slides there. Only 4 or 5 more lines. After simplifying a recorded macro, it looks like: - ActivePresentation.Slides.Range.Copy
-
Windows.Item(Index:=2).Activate
-
ActiveWindow.View.Paste
but there I already had two presentations open. I may have time tonight after you are sound asleep to do it in C#. This is my first venture with PowerPoint InterOp. Makes regular PoPo programming look easy. Stay tuned and/or try it yourself. If you try it yourself, you'll need to save a DocumentWindow object from the merged Presentation. I suspect that it is ppPres.Windows(1). Then you won't need the Activate, just an Open, Copy & Paste for each file.
Well, it sort of works! It was very annoying. I have a new rule: NEVER do InterOp in C#: it should be called InterNoOp. Maybe you can make it better! If so, it would be great to post your code. HTH --Sam - using System;
-
using System.Collections.Generic;
-
using System.ComponentModel;
-
using System.Data;
-
using System.Drawing;
-
using System.Text;
-
using System.Windows.Forms;
-
using PowerPoint = Microsoft.Office.Interop.PowerPoint; // Add a reference to Microsoft.Office.Interop.PowerPoint.dll
-
using Office = Microsoft.Office.Core; // Add a reference to office.dll
-
namespace PowerPointCombine
-
{
-
public partial class Form1 : Form
-
{
-
public Form1()
-
{
-
InitializeComponent();
-
}
-
private void button1_Click(object sender, EventArgs e)
-
{
-
openFileDialog1.Filter = "Presentations (*.ppt)|*.ppt|All files (*.*)|*.*";
-
openFileDialog1.FilterIndex = 1;
-
openFileDialog1.Multiselect = true;
-
openFileDialog1.Title = "Select Presentations To Merge";
-
openFileDialog1.ShowDialog();
-
// Create an instance of PowerPoint, make it visible, and open a new pres.
-
PowerPoint.ApplicationClass ppApp = new PowerPoint.ApplicationClass();
-
ppApp.Visible = Office.MsoTriState.msoTrue;
-
PowerPoint.Presentations ppSet = ppApp.Presentations;
-
PowerPoint.Presentation ppMergedPres = ppSet.Add(Office.MsoTriState.msoTrue);
-
PowerPoint.Slides ppMergedSlides = ppMergedPres.Slides;
-
PowerPoint.DocumentWindows ppWindows = ppMergedPres.Windows;
-
PowerPoint.DocumentWindow ppWindow = ppWindows[1];
-
PowerPoint.View ppMergedView = ppWindow.View;
-
PowerPoint.Presentation ppPres = null;
-
PowerPoint.Slides ppSlides = null;
-
foreach (string f in openFileDialog1.FileNames)
-
{
-
//ppSlides.InsertFromFile(f, ppSlides.Count, 1, 999);
-
ppPres = ppSet.Open(f, Office.MsoTriState.msoTrue, Office.MsoTriState.msoFalse, Office.MsoTriState.msoTrue);
-
ppSlides = ppPres.Slides;
-
for (int i=ppSlides.Count; i>=1; i--)
-
{
-
ppSlides[i].Copy();
-
ppMergedView.Paste();
-
}
-
ppPres.Close();
-
}
-
ppMergedPres.SaveAs(@"C:\Documents and Settings\Sam\My Documents\Merged.ppt", PowerPoint.PpSaveAsFileType.ppSaveAsPresentation, Office.MsoTriState.msoFalse);
-
ppMergedPres.Close();
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppMergedPres);
-
ppMergedPres = null;
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppSlides);
-
ppSlides = null;
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppSet);
-
ppSet = null;
-
ppApp.Quit();
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppApp);
-
ppApp = null;
-
}
-
}
-
}
Hi again ...
Got dragged into something else ... anyhow ... trying to find the references .. however they seem to be missing. There's no interop or core ...
Oh and I'm doing this on a web form?!?!
Hi again ...
Got dragged into something else ... anyhow ... trying to find the references .. however they seem to be missing. There's no interop or core ...
Oh and I'm doing this on a web form?!?!
Why, Why, Why, etc
You have to download Interop. Have you done that?
If you have Visual Studio, then you follow the download instructions.
If you have Express, you just add the ref by browsing to the Interop directory.
When googling for info about this, I remember a lot of whining about Interop & web. Do you really need a Web form? If so, I'd do some google searches.
Do you have to do this in C#? VB would be easier. It allows missing value parameters, so the easy InsertFromFile would work. If you must do it in C#, then I think that it would be easier to just open each presentation, get the slide count, and close it. Then, again, you could use InsertFromFile.
Have you thought about how to order the presentations? Since XP, the OpenFileDialog does not have any order except insanity?
Aren't you glad you got dragged into something else? BTW, I don't do web, so I'll be no help. :) Sam
Thanks Sam ...
Got those reference's ... !
Currently I have the first bit (getting the files and ordering them) done in C# ... I just assumed since part of it was working that way the rest would be done in C# ....
The files are ordered in a listbox ... these I guess i'll need to pass as a collection to the function you've written above...
The function for getting and ordering the files are: -
public partial class FullQuestionnaire : System.Web.UI.Page
-
{
-
protected void Page_Load(object sender, EventArgs e)
-
{
-
-
}
-
-
protected void Blue(object sender, EventArgs e)
-
{
-
foreach(ListItem item in CheckBoxList1.Items)
-
{
-
if (item.Selected && !FileSelectedListBox.Items.Contains(item))
-
{
-
FileSelectedListBox.Items.Add(new ListItem(item.Text, item.Value));
-
}
-
else if (!item.Selected && FileSelectedListBox.Items.Contains(item))
-
{
-
FileSelectedListBox.Items.Remove(item);
-
}
-
}
-
}
-
protected void Button1_Click(object sender, EventArgs e)
-
{
-
-
}
-
}
-
-
-
My first .NET app ... muddling through as you can see .. the something else I was pulled into wasn't that great!!!
Hiya,
From looking about i've got the following bit of code to get the ListBox Items into and arra to pass to your function ....
However, since i'm very new to C# this isn't making much sense to me.
For example, what does the <string> bit mean ... do I pass the name of the ListBox ... or is this a new variable? -
-
protected void SomeEvent(...)
-
{
-
//get selected values
-
List<string> selected = new List<string>();
-
foreach(ListItem item in myControl.Items)
-
{
-
if(item.selected)
-
{
-
selected.Add(item.Value);
-
}
-
}
-
//call function
-
MyClass c = new MyClass(...);
-
c.MyFunction(selected.ToArray());
-
}
-
-
-
Thanks,
J
p.s. You wouldn't know of a good place to go brush up on my C#???!!!
Hi again ...
Figured out the array thing but am having a couple of issues with the way i'm passing in the file names:
I get the error:
The best overloaded method match for 'Microsoft.Office.Interop.PowerPoint.Presentations .Open(string, Microsoft.Office.Core.MsoTriState, Microsoft.Office.Core.MsoTriState, Microsoft.Office.Core.MsoTriState)' has some invalid arguments
This is the code that I've got now: -
protected void Button1_Click(object sender, EventArgs e)
-
// Create an instance of PowerPoint, make it visible, and open a new pres.
-
Microsoft.Office.Interop.PowerPoint.ApplicationClass ppApp = new Microsoft.Office.Interop.PowerPoint.ApplicationClass();
-
ppApp.Visible = Office.MsoTriState.msoTrue;
-
Powerpoint.Presentations ppSet = ppApp.Presentations;
-
Powerpoint.Presentation ppMergedPres = ppSet.Add(Office.MsoTriState.msoTrue);
-
Powerpoint.Slides ppMergedSlides = ppMergedPres.Slides;
-
Powerpoint.DocumentWindows ppWindows = ppMergedPres.Windows;
-
Powerpoint.DocumentWindow ppWindow = ppWindows[1];
-
Powerpoint.View ppMergedView = ppWindow.View;
-
Powerpoint.Presentation ppPres = null;
-
Powerpoint.Slides ppSlides = null;
-
System.Collections.Generic.List<String> selected = new System.Collections.Generic.List<String>();
-
foreach (ListItem item in FileSelectedListBox.Items)
-
{
-
if (item.Selected)
-
{
-
selected.Add(item.Value);
-
//ppSlides.InsertFromFile(f, ppSlides.Count, 1, 999);
-
ppPres = ppSet.Open(selected, Office.MsoTriState.msoTrue, Office.MsoTriState.msoFalse, Office.MsoTriState.msoTrue);
-
ppSlides = ppPres.Slides;
-
for (int i = ppSlides.Count; i >= 1; i--)
-
{
-
ppSlides[i].Copy();
-
ppMergedView.Paste();
-
}
-
ppPres.Close();
-
}
-
}
-
-
}
-
Thanks
J
The first parameter of the Open must be a string. Also, probably easier to use ListBox::CheckedItems -
foreach (object o in FileSelectedListBox.CheckedItems)
-
{
-
ppPres = ppSet.Open(o.ToString(), Office.MsoTriState.msoTrue, Office.MsoTriState.msoFalse, Office.MsoTriState.msoTrue);
-
}
-
The first parameter of the Open must be a string. Also, probably easier to use ListBox::CheckedItems -
foreach (object o in FileSelectedListBox.CheckedItems)
-
{
-
ppPres = ppSet.Open(o.ToString(), Office.MsoTriState.msoTrue, Office.MsoTriState.msoFalse, Office.MsoTriState.msoTrue);
-
}
-
On the line -
foreach (object o in FileSelectedListBox.CheckedItems)
-
How do I get the items value (which is the file address) rather than just the file name (which is causing an error on Powerpoint because it can't find the file by just its name)??
Thanks
J
I'm confused. CheckedListBox.Items[i] does not have a Value property. It is just the string that you see in the box. Guess this has something to do with ListItem in your code. What is ListItem?
So, a little tipe:
-> PowerPoint.Application ppApp = new PowerPoint.ApplicationClass();
It's perfect! -
-
using System;
-
using System.Collections.Generic;
-
using System.ComponentModel;
-
using System.Data;
-
using System.Drawing;
-
using System.Text;
-
using System.Windows.Forms;
-
using PowerPoint = Microsoft.Office.Interop.PowerPoint; // Add a reference to Microsoft.Office.Interop.PowerPoint.dll
-
using Office = Microsoft.Office.Core; // Add a reference to office.dll
-
-
namespace PowerPointCombine
-
{
-
public partial class MainForm : Form
-
{
-
-
public MainForm()
-
{
-
InitializeComponent();
-
}
-
-
private void button1_Click(object sender, EventArgs e)
-
{
-
openFileDialog1.Filter = "Presentations (*.ppt)|*.ppt|All files (*.*)|*.*";
-
openFileDialog1.FilterIndex = 1;
-
openFileDialog1.Multiselect = true;
-
openFileDialog1.Title = "Select Presentations To Merge";
-
openFileDialog1.ShowDialog();
-
// Create an instance of PowerPoint, make it visible, and open a new pres.
-
-
PowerPoint.Application ppApp = new PowerPoint.ApplicationClass();
-
//ppApp.Visible = Office.MsoTriState.msoTrue;
-
PowerPoint.Presentations ppSet = ppApp.Presentations;
-
PowerPoint.Presentation ppMergedPres = ppSet.Add(Office.MsoTriState.msoTrue);
-
PowerPoint.Slides ppMergedSlides = ppMergedPres.Slides;
-
PowerPoint.Presentation ppPres = null;
-
foreach (string f in openFileDialog1.FileNames)
-
{
-
ppPres = ppSet.Open(f, Office.MsoTriState.msoTrue, Office.MsoTriState.msoFalse, Office.MsoTriState.msoFalse);
-
ppMergedSlides.InsertFromFile(f, ppMergedSlides.Count, 1, ppPres.Slides.Count);
-
ppPres.Close();
-
}
-
ppMergedPres.SaveAs(@"C:\Merged.ppt", PowerPoint.PpSaveAsFileType.ppSaveAsPresentation, Office.MsoTriState.msoFalse);
-
ppMergedPres.Close();
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppMergedPres);
-
ppMergedPres = null;
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppSet);
-
ppSet = null;
-
ppApp.Quit();
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppApp);
-
ppApp = null;
-
}
-
}
-
Hi ...
Just replacing the opendialogue with the code below ... so user can select from a set group of presentations ... other than that your code is perfect for what I'm trying to do. The ListItem is CheckBoxList1 : -
protected void Blue(object sender, EventArgs e)
-
{
-
foreach(ListItem item in CheckBoxList1.Items)
-
{
-
if (item.Selected && !FileSelectedListBox.Items.Contains(item))
-
{
-
FileSelectedListBox.Items.Add(new ListItem(item.Text, item.Value));
-
}
-
else if (!item.Selected && FileSelectedListBox.Items.Contains(item))
-
{
-
FileSelectedListBox.Items.Remove(item);
-
}
-
}
-
}
-
Thanks
J
Hi ...
The ListItem is CheckBoxList1 :
J
I forgot that you are doing a web app, so I guess the properties are different. Glad it works!
I forgot that you are doing a web app, so I guess the properties are different. Glad it works!
It's not working at the minute ... I can't seem to pass the values of the list of Items in the FileSelectedListBox, into your foreach loop: -
foreach (string f in openFileDialog1.FileNames)
-
Do you know how I can pass this??
Thanks again
J
It's all OK I realised what I was doing wrong I just need to pass this: -
foreach (ListItem o in FileSelectedListBox.Items)
-
Right let me get onto the rest of it .... :(
J
Hi ...
Got the above working a treat!! Thanks very much ...
Is it possible to put text box values into the first slide of the presentation that is going to contain the merged powerpoint files?
Been trawling the web and I can't find anything relating to this?
Thanks
J
I do have something now which is as follows: -
Powerpoint._Slide objSlide;
-
Powerpoint.TextRange objTextRng = null;
-
//ppApp.PresentationNewSlide
-
objSlide = ppPres.Slides.Add(1, Powerpoint.PpSlideLayout.ppLayoutBlank);
-
//objSlide = ppSlides.Add(1, Powerpoint.PpSlideLayout.ppLayoutText);
-
objTextRng = objSlide.Shapes[1].TextFrame.TextRange;
-
objTextRng.Text = "My Presentation";
-
-
But its causing the "New" Keyword is needed on the following line but I can't see where to add this ... can you see what I'm missing? -
objSlide = ppPres.Slides.Add(1, Powerpoint.PpSlideLayout.ppLayoutBlank);
-
Thanks so much
J
No Interop here, but your code looks good to me. Best I can do right now is write a macro which looks just like your code. I'll try it in C# tonight. -
Dim ppPres As PowerPoint.Presentation
-
Set ppPres = ActivePresentation
-
Dim ppSlide As PowerPoint.Slide
-
Set ppSlide = ppPres.Slides.Add(1, ppLayoutText)
-
ppSlide.Shapes(1).TextFrame.TextRange.Text = "Help"
-
ppSlide.Shapes(2).TextFrame.TextRange.Text = "Me"
-
You probably have to create a Slides object (line 5). This worked for me: -
PowerPoint.ApplicationClass ppApp = new PowerPoint.ApplicationClass();
-
ppApp.Visible = Office.MsoTriState.msoTrue;
-
PowerPoint.Presentations ppSet = ppApp.Presentations;
-
PowerPoint.Presentation ppPres = ppSet.Add(Office.MsoTriState.msoTrue);
-
PowerPoint.Slides ppSlides = ppPres.Slides;
-
PowerPoint.Slide ppSlide = ppSlides.Add(1, PowerPoint.PpSlideLayout.ppLayoutText);
-
ppSlide.Shapes[1].TextFrame.TextRange.Text = "Sample Slide";
-
ppSlide.Shapes[2].TextFrame.TextRange.Text = "Bullet One" + System.Environment.NewLine + "Bullet Two";
-
-
Hi ...
It's working though, the merged files bit is opening another presentation file and adding the merged files to that ... how do I get the merged files to follow on from the automatically entered text?
Hi ...
It's working though, the merged files bit is opening another presentation file and adding the merged files to that ... how do I get the merged files to follow on from the automatically entered text?
In our code snippets, we've used ppSlides in two different ways, as the new presentation (line 5 in #27 above), and as the old presentation (line 21 in #15 above). You just need to identify all of your PP references and make sure that they are named properly. Maybe easiest to replace ppMergedObject with newObject (newPres, newSlides, newSlide) and ppObject with oldObject (oldPres, oldSlides). Also, you should use ewertonrp's #19 above, so that you can use the InsertFromFile (line 39).
Are we confused yet?
Are we confused yet?
Errrrr yeah confused - how did you know???
Errrrr yeah confused - how did you know???
That's why we get paid the big bucks!
This is as far as I got ... the addition of the extra slide just isn't working ... can you see what i'm missing....??? -
Powerpoint.ApplicationClass ppApp = new Powerpoint.ApplicationClass();
-
ppApp.Visible = Office.MsoTriState.msoTrue;
-
Powerpoint.Presentations ppSet = ppApp.Presentations;
-
Powerpoint.Presentation ppMergedPres = ppSet.Add(Office.MsoTriState.msoTrue);
-
Powerpoint.Slides ppMergedSlides = ppMergedPres.Slides;
-
Powerpoint.DocumentWindows ppWindows = ppMergedPres.Windows;
-
Powerpoint.DocumentWindow ppWindow = ppWindows[1];
-
Powerpoint.View ppMergedView = ppWindow.View;
-
Powerpoint.Presentation ppPres = ppSet.Add(Office.MsoTriState.msoTrue);
-
Powerpoint.Slides ppSlides = ppPres.Slides;
-
Powerpoint.Slide ppSlide = ppSlides.Add(1, Powerpoint.PpSlideLayout.ppLayoutText);
-
System.Collections.Generic.List<String> selected = new System.Collections.Generic.List<String>();
-
foreach (ListItem o in FileSelectedListBox.Items)
-
{
-
-
//ppSlides.InsertFromFile(o, ppSlides.Count, 1, 999);
-
ppPres = ppSet.Open(o.Value.ToString(), Office.MsoTriState.msoTrue, Office.MsoTriState.msoFalse, Office.MsoTriState.msoTrue);
-
ppSlides = ppPres.Slides;
-
for (int i = ppSlides.Count; i >= 1; i--)
-
{
-
ppSlides[i].Copy();
-
ppMergedView.Paste();
-
}
-
ppPres.Close();
-
}
-
-
//ppSlides = ppPres.Slides;
-
ppSlides.Add(1, Powerpoint.PpSlideLayout.ppLayoutText);
-
ppSlide.Shapes[1].TextFrame.TextRange.Text = "Questionnaire";
-
ppSlide.Shapes[2].TextFrame.TextRange.Text = relManNameTextBox.Text;
-
-
string sFileName = System.IO.Path.ChangeExtension(System.IO.Path.GetRandomFileName(), "ppt");
-
ppMergedPres.SaveAs(@"V:\projects\JG\PitchBook\PitchBook\Presentations\Built\" + sFileName, Powerpoint.PpSaveAsFileType.ppSaveAsPresentation, Office.MsoTriState.msoFalse);
-
ppMergedPres.Close();
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppMergedPres);
-
ppMergedPres = null;
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppSlides);
-
ppSlides = null;
-
ppApp.Quit();
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppSet);
-
ppSet = null;
-
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppApp);
-
ppApp = null;
-
All of your ppSlides.Add should be ppMergedSlides.Add
I've posted a solution in javascript here: http://code.google.com/p/powerpointjoin/
Hi Guys, that Code for Merging Single Slides works perfect for me! But one Problem! My single Slides do have a Template( Background, Font, etc...)...
When i merge the Slides the merge.ppt dont have this Template! How can i fix this?
How about a solution for Mac users? I have a similar situation where I need to combine multiple slides from different presentations into one presentation. Ideally, I'd like to keep the formatting in tact.
Looking for a solution on this...thanks.
Post your reply Sign in to post your reply or Sign up for a free account.
Similar topics
2 posts
views
Thread by mheydman |
last post: by
|
1 post
views
Thread by Bret |
last post: by
|
1 post
views
Thread by Ryan |
last post: by
|
reply
views
Thread by Ata |
last post: by
|
4 posts
views
Thread by Joseph |
last post: by
|
reply
views
Thread by Marc Eggenberger |
last post: by
|
1 post
views
Thread by barry |
last post: by
|
8 posts
views
Thread by Rut |
last post: by
| | | | | | | | | | | |