我们不能从PPT幻灯片复制形状(S),以word文档在C#中的原单格式? [英] Can't we copy shape(s) from a PPT slide to word document in the orginal format in C#?

查看:290
本文介绍了我们不能从PPT幻灯片复制形状(S),以word文档在C#中的原单格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从PPT复制自选图形文字。但其作为复制图片格式。我们不能编辑字文本或形状。 ?如何避免这种



代码我米使用不会给预期esult:

 的foreach(Microsoft.Office.Interop.PowerPoint.Shape形状slide.Shapes)
{
如果(targetDoc!= NULL)
{
shape.Copy() ;
this.wordApp.ActiveWindow.Selection.Paste();
}
}


解决方案

有些我manged EMF格式复制形状。

  shape.Copy(); 

对象objectMissing = System.Reflection.Missing.Value;
对象objLink = FALSE;
对象OBJTYPE = WdPasteDataType.wdPasteEnhancedMetafile;
wordApp.ActiveWindow.Selection.Range.PasteSpecial(REF objectMissing,裁判objLink,裁判objectMissing,裁判objectMissing,裁判OBJTYPE,裁判objectMissing,裁判objectMissing);


I tried to copy autoshape from PPT to word. but its copying as picture format. We cant edit the text or shape in word. How to avoid this?

Code I m using not giving expected esult:

foreach (Microsoft.Office.Interop.PowerPoint.Shape shape in slide.Shapes)
{
   if (targetDoc != null)
   {
      shape.Copy();
      this.wordApp.ActiveWindow.Selection.Paste();
   }
 }

解决方案

somewhat i manged to copy shape in EMF format.

shape.Copy(); 

object objectMissing = System.Reflection.Missing.Value;                                                                             
object objLink = false;
object objType = WdPasteDataType.wdPasteEnhancedMetafile;                                        
wordApp.ActiveWindow.Selection.Range.PasteSpecial(ref objectMissing, ref objLink, ref objectMissing, ref objectMissing, ref objType, ref objectMissing, ref objectMissing);

这篇关于我们不能从PPT幻灯片复制形状(S),以word文档在C#中的原单格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆