如何使用书签从单词

如何使用书签从单词

本文介绍了如何使用书签从单词中获取自动整形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


从Word(2007)文档复制形状时遇到问题.如何使用书签从单词复制形状?有人可以帮我吗?
这就是我在做什么:


Hi
I am facing problem while copying a shape from word(2007) document. How to copy a shape from word using bookmark? Could some one help me?
This is what i am doing:


object FileName = objTemplateFile;
object oMissing = System.Reflection.Missing.Value;                    
object oWhat = WdGoToItem.wdGoToBookmark;
object oName = "MyBookmark";
//Opening source document in hidden mode
objWord = wordApp.Documents.Open(ref FileName, ref oFalse, ref oTrue, ref oFalse, ref oMissing, ref oMissing, ref oMissing,ref oMissing, ref oMissing, ref oMissing, ref oFalse, ref  oFalse, ref oMissing, ref oTrue, ref oMissing, ref oMissing);

objWord.Bookmarks.get_Item(ref oName).Range.Select();
objWord.Range(ref oMissing, ref oMissing).Copy();
//Copy the shape in to target dc
wordApp.ActiveWindow.Selection.Paste();      

推荐答案

objWord.Bookmarks.get_Item(ref oName).Range.Copy(); // Copy range directly instead of selecting it and then trying to copy it

//Copy the shape in to target dc
wordApp.ActiveWindow.Selection.Paste();


这篇关于如何使用书签从单词中获取自动整形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 04:32