C
Csabi
Hello,
I'm using .NET with powerpoint 2003 (anyway I want to use this app with PPT
2000 too!), with the autogenerated interop assemblies.
I want to paste RTF-format texts into Shapes in Powerpoint, here's my code
snippet:
System.Windows.Forms.DataObject dataObj = new
System.Windows.Forms.DataObject(System.Windows.Forms.DataFormats.Rtf,
bmwv.Value);
Clipboard.SetDataObject(dataObj, false);
try
{
//shape.TextFrame.TextRange.Paste();
shape.TextFrame.TextRange.PasteSpecial(PowerPoint.PpPasteDataType.ppPasteRTF,
Microsoft.Office.Core.MsoTriState.msoFalse, "", 0, "",
Microsoft.Office.Core.MsoTriState.msoFalse);
}
catch(Exception ex)
{
string strMsg = ex.Message;
//shape.TextFrame.TextRange.Text = "";
}
dataObj = new DataObject(DataFormats.Text, "");
Clipboard.SetDataObject(dataObj, true);
Sorry if you can read hardly this snippet.
So, the bmwv.Value property contains the pasteable RTF-formatted text.
I tried with even PasteSpecial (as in the source above) and Paste()
functions, but always get the same error:
"TextRange (unknown member) : Invalid request. The specified data type is
unavailable."
Anyone maybe any solution? This problem drives me crazy... It'd be urgent :/
Bye,
Csabi
I'm using .NET with powerpoint 2003 (anyway I want to use this app with PPT
2000 too!), with the autogenerated interop assemblies.
I want to paste RTF-format texts into Shapes in Powerpoint, here's my code
snippet:
System.Windows.Forms.DataObject dataObj = new
System.Windows.Forms.DataObject(System.Windows.Forms.DataFormats.Rtf,
bmwv.Value);
Clipboard.SetDataObject(dataObj, false);
try
{
//shape.TextFrame.TextRange.Paste();
shape.TextFrame.TextRange.PasteSpecial(PowerPoint.PpPasteDataType.ppPasteRTF,
Microsoft.Office.Core.MsoTriState.msoFalse, "", 0, "",
Microsoft.Office.Core.MsoTriState.msoFalse);
}
catch(Exception ex)
{
string strMsg = ex.Message;
//shape.TextFrame.TextRange.Text = "";
}
dataObj = new DataObject(DataFormats.Text, "");
Clipboard.SetDataObject(dataObj, true);
Sorry if you can read hardly this snippet.
So, the bmwv.Value property contains the pasteable RTF-formatted text.
I tried with even PasteSpecial (as in the source above) and Paste()
functions, but always get the same error:
"TextRange (unknown member) : Invalid request. The specified data type is
unavailable."
Anyone maybe any solution? This problem drives me crazy... It'd be urgent :/
Bye,
Csabi