我们不能将 PPT 幻灯片中的形状复制到 C# 中原始格式的 Word 文档中吗? [英] Can't we copy shape(s) from a PPT slide to word document in the orginal format in C#?
本文介绍了我们不能将 PPT 幻灯片中的形状复制到 C# 中原始格式的 Word 文档中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试将自动形状从 PPT 复制到 Word.但它复制为图片格式.我们无法在 word 中编辑文本或形状.如何避免这种情况?
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();
}
}
推荐答案
我设法复制了 EMF 格式的形状.
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 幻灯片中的形状复制到 C# 中原始格式的 Word 文档中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文