|
发表于 2013-5-24 18:02:26
|
显示全部楼层
[code=csharp] if (1 == 1)
{
object bookmarkName = "SenderName";
Microsoft.Office.Interop.Word.Range rng = wordDoc2.Bookmarks.get_Item(ref bookmarkName).Range;
rng.Text = SenderName;
object range = rng;
wordDoc2.Bookmarks.Add("SenderName", ref range);
}
if (1 == 1)
{
object bookmarkName = "ShipperAddress";
Microsoft.Office.Interop.Word.Range rng = wordDoc2.Bookmarks.get_Item(ref bookmarkName).Range;
rng.Text = ShipperAddress;
object range = rng;
wordDoc2.Bookmarks.Add("ShipperAddress", ref range);
}
if (1 == 1)
{
object bookmarkName = "SenderCode";
Microsoft.Office.Interop.Word.Range rng = wordDoc2.Bookmarks.get_Item(ref bookmarkName).Range;
rng.Text = SenderCode;
object range = rng;
wordDoc2.Bookmarks.Add("SenderCode", ref range);
}[/code]
这种情况可以把If语句去掉的,因为是永为True的相当于不加IF |
|