private void insert_ScreenShot_width(int intWidth)
{
//-----------------<
insert_ScreenShot_width() >-----------------
//< init >
Word.Document doc = Globals.ThisAddIn.Application.ActiveDocument;
Word.Application app = Globals.ThisAddIn.Application;
//</ init >
//< check >
//*no bmp in clipboard
//if (result !=
System.Windows.Forms.DialogResult.OK)
//{ return; }
//</ check >
//< get selection >
Word.Range act_Image_Range = app.Selection.Range;
//</ get selection >
//----< Clipboard einfuegen >----
//*als Bitmap
app.Selection.Collapse(Word.WdCollapseDirection.wdCollapseEnd );
app.Selection.PasteSpecial(DataType:Word.WdPasteDataType.wdPasteBitmap);
//----</ Clipboard einfuegen >----
////< markieren >
app.Selection.MoveLeft(Unit:
Word.WdUnits.wdCharacter, Count: 1, Extend:
Word.WdMovementType.wdExtend);
////</
markieren >
//----<
Groesse anpassen und Rahmen >----
Word.InlineShape inlineShape;
inlineShape =
app.Selection.InlineShapes[1];
inlineShape.Line.Style = Office.MsoLineStyle.msoLineSingle;
inlineShape.Line.Weight
= 2;
//----</
Groesse anpassen und Rahmen >----
//--< size to width >--
//< scale >
inlineShape.LockAspectRatio =
Office.MsoTriState.msoTrue;
inlineShape.Width =
app.CentimetersToPoints(intWidth);
//size
//</ scale >
//--</ size to width >--
app.Selection.InsertBefore("\n");
app.Selection.InsertAfter("\n");
app.Selection.MoveDown();
//-----------------</
insert_ScreenShot_width() >-----------------
}
|