inserting image from a picture box in windows form application to a word document
i have this windows form application where there is a picture box.i want that upon clicking save button the picture is saved into a ms word file and saved.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bechir BejaouiPosted Dec 18, 2008, 6:34 PM
bibhu dasPosted Dec 18, 2008, 12:16 AM
Bechir BejaouiPosted Dec 17, 2008, 6:47 PM
{
Word.Application word = new Word.Application();
word.Visible = true;
object visible = true;
object fileName = path;
object optional = System.Type.Missing;
Word.Document doc = app.Documents.Open(ref fileName,
ref optional,
ref
optional,
ref optional,
ref optional,
ref optional,
ref optional,
ref
optional,
ref optional,
ref optional);
Object myImageRange = word.ActiveDocument.Paragraphs[ParagraphNumber].Range;
Object LinkToFile = false;
Object SaveWithWord = true;
word.ActiveDocument.InlineShapes.AddPicture(pictureBox1.ImageLocation, ref LinkToFile,
ref SaveWithWord,
ref myImageRange);
}