using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Nevron.UI.WinForm.Controls;
using Office = Microsoft.Office.Core;
using Word = Microsoft.Office.Interop.Word;
using System.Drawing.Imaging;
namespace UITest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
object oMissing = System.Reflection.Missing.Value;
object oTrue = true;
object oFalse = false;
Word.Application wdApp = null;
// Start a new Word instance if necessary
if (wdApp == null)
wdApp = new Word.ApplicationClass();
// Create a new document
Word.Document wdDoc = wdApp.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
wdApp.Selection.InlineShapes.AddPicture("c:\\background.gif", ref oMissing, ref oTrue, ref oMissing);
object oFileName = "c:\\image.doc";
wdDoc.SaveAs(ref oFileName, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing);
wdApp.Quit(ref oFalse, ref oMissing, ref oMissing);
}
}
}