0
我想替换mergefiled与图像 ,我做到了。 现在我想要移动图像有点像在MS单词中使用鼠标。 我该怎么做? 这是我的代码。我怎样才能移动图像以毫秒字使用C#
//hash = values for find, field = mergefields in word document
foreach (string s in hash.Keys)//if (hash key == field)
{
hashVal = hash[s].ToString();
Find findObj = app.Selection.Find;
findObj.ClearFormatting();
findObj.Text = frontM + fdName + backM; //=mergeField
if (findObj.Text.Equals(frontM + s + backM))
{
merge.Select();
app.Selection.TypeBackspace();
word.InlineShapes.AddPicture(hashVal, true, false, app.Selection.Range).ConvertToShape().WrapFormat.Type = WdWrapType.wdWrapFront;
//app.Selection.MoveUp(); ????????
}
}
感谢您的评论,是否有可能在C#?它似乎为VBA – Hee
我稍微替换了示例。 VBA文档更好,所以我留下了链接。 –