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文檔更好,所以我留下了鏈接。 –