Drag powerpoint slide to an external application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working on a new application and I would like to be able to drag and
drop slides from powerpoint into my application. Are there any examples of
how to do this? Do I need to write some kind of COM add-in to make this
happen or can it all be done from the clipboard? I am planning to develop my
application in csharp. Is there any reason that this wouldn't work?

Thanks,

Joe
 
I have a similar issue - I've gotten this far, if someone could offer up
the next level of detail...

In my target external app - I setup a simple drag/drop control - and
wanted to see if I could get at the slide being dropped off. I selected
a slide from the slide-sorter, and drag/drop it on a textbox control as
a test.

The list of GetFormats shows the following:
Embedded Object
Object Descriptor
EnhancedMetafile
MetaFilePict
Link Source
Link Source Descriptor
<< this next guy looks interesting,but how do I use it?
PowerPoint 8.0 Internal Slides
ActiveClipboard

....
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

using System.Diagnostics;

using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using System.Runtime.InteropServices.ComTypes;
namespace MyNS.Designer
{
public partial class TestPanel : UserControl
{
// ...snip - normal form/usercontrol stuff...

private void textBox1_DragDrop(object sender, DragEventArgs e)
{
bool test;
string[] fmts = e.Data.GetFormats();
foreach (string s in fmts)
Debug.WriteLine(s);

DataFormats.Format myFormat = DataFormats.GetFormat("PowerPoint
8.0 Internal Slides");
if (e.Data.GetDataPresent(myFormat.Name))
{
// should be a valid format string...
Debug.WriteLine("GetDataPresent for " + myFormat.Name);
}
// so now how do I get the ppt.slide I just did a drag&drop with?
}
}
 
It seems that you'd first have to write an application that can interpret and
display Slide data (iow, reproduce a great deal of PowerPoint itself, or at least
the viewer).

Depending on what you're after, could you use a bitmap or EMF? It should be
possible to write code to drop one of these into e.g. a picture box control (not
sure what a textbox would make of a graphic though <g>)

I have a similar issue - I've gotten this far, if someone could offer up
the next level of detail...

In my target external app - I setup a simple drag/drop control - and
wanted to see if I could get at the slide being dropped off. I selected
a slide from the slide-sorter, and drag/drop it on a textbox control as
a test.

The list of GetFormats shows the following:
Embedded Object
Object Descriptor
EnhancedMetafile
MetaFilePict
Link Source
Link Source Descriptor
<< this next guy looks interesting,but how do I use it?
PowerPoint 8.0 Internal Slides
ActiveClipboard

....
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

using System.Diagnostics;

using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using System.Runtime.InteropServices.ComTypes;
namespace MyNS.Designer
{
public partial class TestPanel : UserControl
{
// ...snip - normal form/usercontrol stuff...

private void textBox1_DragDrop(object sender, DragEventArgs e)
{
bool test;
string[] fmts = e.Data.GetFormats();
foreach (string s in fmts)
Debug.WriteLine(s);

DataFormats.Format myFormat = DataFormats.GetFormat("PowerPoint
8.0 Internal Slides");
if (e.Data.GetDataPresent(myFormat.Name))
{
// should be a valid format string...
Debug.WriteLine("GetDataPresent for " + myFormat.Name);
}
// so now how do I get the ppt.slide I just did a drag&drop with?
}
}
I am working on a new application and I would like to be able to drag and
drop slides from powerpoint into my application. Are there any examples of
how to do this? Do I need to write some kind of COM add-in to make this
happen or can it all be done from the clipboard? I am planning to develop my
application in csharp. Is there any reason that this wouldn't work?

Thanks,

Joe
 
Depending on what you're after, could you use a bitmap or EMF?

EO or EMF might be something - if in the end I could extract the SlideID
value - I'd be good to go. Agree however, textbox control is contrived
for the sample code - just for demo drag/drop & show the slideID value
of the slide.
It seems that you'd first have to write an application that can

I do have the Powerpoint PIA ala "using PowerPoint =
Microsoft.Office.Interop.PowerPoint;", my thought was this gives about
as much of Powerpoint & related functionality as one could expect to
get. (i.e. I can create & modify slides, create new presentations, save,
delete, yada, yada).

Given we do have the actual PP object types, there isn't any way to cast
the data payload and a Slide or Slides object? (Esp since one of the
formats alludes to notion that the data object is some sort of Slide.)

Thanks,

Jimbo
Steve said:
It seems that you'd first have to write an application that can interpret and
display Slide data (iow, reproduce a great deal of PowerPoint itself, or at least
the viewer).

Depending on what you're after, could you use a bitmap or EMF? It should be
possible to write code to drop one of these into e.g. a picture box control (not
sure what a textbox would make of a graphic though <g>)

I have a similar issue - I've gotten this far, if someone could offer up
the next level of detail...

In my target external app - I setup a simple drag/drop control - and
wanted to see if I could get at the slide being dropped off. I selected
a slide from the slide-sorter, and drag/drop it on a textbox control as
a test.

The list of GetFormats shows the following:
Embedded Object
Object Descriptor
EnhancedMetafile
MetaFilePict
Link Source
Link Source Descriptor
<< this next guy looks interesting,but how do I use it?
PowerPoint 8.0 Internal Slides
ActiveClipboard

....
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

using System.Diagnostics;

using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using System.Runtime.InteropServices.ComTypes;
namespace MyNS.Designer
{
public partial class TestPanel : UserControl
{
// ...snip - normal form/usercontrol stuff...

private void textBox1_DragDrop(object sender, DragEventArgs e)
{
bool test;
string[] fmts = e.Data.GetFormats();
foreach (string s in fmts)
Debug.WriteLine(s);

DataFormats.Format myFormat = DataFormats.GetFormat("PowerPoint
8.0 Internal Slides");
if (e.Data.GetDataPresent(myFormat.Name))
{
// should be a valid format string...
Debug.WriteLine("GetDataPresent for " + myFormat.Name);
}
// so now how do I get the ppt.slide I just did a drag&drop with?
}
}
I am working on a new application and I would like to be able to drag and
drop slides from powerpoint into my application. Are there any examples of
how to do this? Do I need to write some kind of COM add-in to make this
happen or can it all be done from the clipboard? I am planning to develop my
application in csharp. Is there any reason that this wouldn't work?

Thanks,

Joe

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
EO or EMF might be something - if in the end I could extract the SlideID
value - I'd be good to go.

I doubt you'd be able to do that; the EMF wouldn't "know" where it came from, I don't
think.
Agree however, textbox control is contrived
for the sample code - just for demo drag/drop & show the slideID value
of the slide.

OK, I see.
I do have the Powerpoint PIA ala "using PowerPoint =
Microsoft.Office.Interop.PowerPoint;", my thought was this gives about
as much of Powerpoint & related functionality as one could expect to
get. (i.e. I can create & modify slides, create new presentations, save,
delete, yada, yada).

But that's by automating PPT itself, no?
Given we do have the actual PP object types, there isn't any way to cast
the data payload and a Slide or Slides object? (Esp since one of the
formats alludes to notion that the data object is some sort of Slide.)

A slide, sure, but in a private clipboard format that probably only PPT understands.

Jimbo
Steve said:
It seems that you'd first have to write an application that can interpret and
display Slide data (iow, reproduce a great deal of PowerPoint itself, or at least
the viewer).

Depending on what you're after, could you use a bitmap or EMF? It should be
possible to write code to drop one of these into e.g. a picture box control (not
sure what a textbox would make of a graphic though <g>)

I have a similar issue - I've gotten this far, if someone could offer up
the next level of detail...

In my target external app - I setup a simple drag/drop control - and
wanted to see if I could get at the slide being dropped off. I selected
a slide from the slide-sorter, and drag/drop it on a textbox control as
a test.

The list of GetFormats shows the following:
Embedded Object
Object Descriptor
EnhancedMetafile
MetaFilePict
Link Source
Link Source Descriptor
<< this next guy looks interesting,but how do I use it?
PowerPoint 8.0 Internal Slides
ActiveClipboard

....
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

using System.Diagnostics;

using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using System.Runtime.InteropServices.ComTypes;
namespace MyNS.Designer
{
public partial class TestPanel : UserControl
{
// ...snip - normal form/usercontrol stuff...

private void textBox1_DragDrop(object sender, DragEventArgs e)
{
bool test;
string[] fmts = e.Data.GetFormats();
foreach (string s in fmts)
Debug.WriteLine(s);

DataFormats.Format myFormat = DataFormats.GetFormat("PowerPoint
8.0 Internal Slides");
if (e.Data.GetDataPresent(myFormat.Name))
{
// should be a valid format string...
Debug.WriteLine("GetDataPresent for " + myFormat.Name);
}
// so now how do I get the ppt.slide I just did a drag&drop with?
}
}

joeuser11032004 wrote:
I am working on a new application and I would like to be able to drag and
drop slides from powerpoint into my application. Are there any examples of
how to do this? Do I need to write some kind of COM add-in to make this
happen or can it all be done from the clipboard? I am planning to develop my
application in csharp. Is there any reason that this wouldn't work?

Thanks,

Joe

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
Back
Top