【本文转自】:
http://topic.csdn.net/t/20061023/12/5102071.html
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using
System.Runtime.InteropServices;
namespace WinWordControl
{
public class
DocumentInstanceException :
Exception
{}
public class
ValidDocumentException :
Exception
{}
public class
WordInstanceException :
Exception
{}
public class
WinWordControl :
System.Windows.Forms.UserControl
{
[DllImport("user32.dll")]
public static
extern int
FindWindow(string strclassName,
string strWindowName);
[DllImport("user32.dll")]
static extern
int SetParent(
int hWndChild,
int hWndNewParent);
[DllImport("user32.dll",
EntryPoint="SetWindowPos")]
static extern
bool SetWindowPos(
int hWnd,
// handle
to window
int hWndInsertAfter,
// placement-order
handle
int X,
//
horizontal position
int Y,
//
vertical position
int cx,
// width
int cy,
// height
uint uFlags
// window-positioning
options
);
[DllImport("user32.dll",
EntryPoint="MoveWindow")]