我这里有两个Form1和Formht我在Formht中写了一个Report类并创建了一个Report实例report,然后我想在Form1中也能调用这个实例。。我在Form1中添加了一个Button,在Button中应该写什么代码额。。求大神指导。
public partial class Form1 : Form 
    {
        class Report
        {
            private _Application wordApp = null;
            private _Document wordDoc = null;
            public _Application Application
            {
                get
                {
                    return wordApp;
                }
                set
                {
                    wordApp = value;
                }
            }
            public _Document Document
            {
                get
                {
                    return wordDoc;
                }
                set
                {
                    wordDoc = value;
                }
            }
            // 杀掉winword.exe进程
            public void killWinWordProcess()
            {
                System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("WINWORD");
                foreach (System.Diagnostics.Process process in processes)
                {
                    bool b = process.MainWindowTitle == "";
                    if (process.MainWindowTitle == "")
                    {
                        process.Kill();
                    }
                }
            }
        }        public Form1()
        {
            InitializeComponent();
        }        private void button1_Click(object sender, EventArgs e)
        {        }        private void 借据合同ToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
            //弹出一个新的窗口,显示合同所需填写的部分
            Formht f = null;
            try
            {
                f = new Formht();
                f.ShowDialog(this);
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }        private void button3_Click(object sender, EventArgs e)
        {
          //  string RepPath = @"F:\学习\soarto要求\offce小应用";
           // Report report = new Report();   
          //  report.SaveDocument(RepPath);
        }  public partial class Formht : Form
    {
        class Report
        {
            private _Application wordApp = null;
            private _Document wordDoc = null;
            public _Application Application
            {
                get
                {
                    return wordApp;
                }
                set
                {
                    wordApp = value;
                }
            }
            public _Document Document
            {
                get
                {
                    return wordDoc;
                }
                set
                {
                    wordDoc = value;
                }
            }            //通过模板创建新文档
            public void CreateNewDocument(string filePath)
            {
                killWinWordProcess();
                wordApp = new ApplicationClass();
                wordApp.DisplayAlerts = WdAlertLevel.wdAlertsNone;
                wordApp.Visible = false;
                object missing = System.Reflection.Missing.Value;
                object templateName = filePath;
                wordDoc = wordApp.Documents.Open(ref templateName, ref missing,
                    ref missing, ref missing, ref missing, ref missing, ref missing,
                    ref missing, ref missing, ref missing, ref missing, ref missing,
                    ref missing, ref missing, ref missing, ref missing);
            }            //保存新文件
            public void SaveDocument(string filePath)
            {
                object fileName = filePath;
                object format = WdSaveFormat.wdFormatDocument;//保存格式
                object miss = System.Reflection.Missing.Value;
                wordDoc.SaveAs(ref fileName, ref format, ref miss,
                    ref miss, ref miss, ref miss, ref miss,
                    ref miss, ref miss, ref miss, ref miss,
                    ref miss, ref miss, ref miss, ref miss,
                    ref miss);
                //关闭wordDoc,wordApp对象
                object SaveChanges = WdSaveOptions.wdSaveChanges;
                object OriginalFormat = WdOriginalFormat.wdOriginalDocumentFormat;
                object RouteDocument = false;
                wordDoc.Close(ref SaveChanges, ref OriginalFormat, ref RouteDocument);
                wordApp.Quit(ref SaveChanges, ref OriginalFormat, ref RouteDocument);
            }            //在书签处插入值
            public bool InsertValue(string book, string value)
            {
                object bkObj = book;
                if (wordApp.ActiveDocument.Books.Exists(book))
                {
                    wordApp.ActiveDocument.Books.get_Item(ref bkObj).Select();
                    wordApp.Selection.TypeText(value);
                    return true;
                }
                return false;
            }            //插入图片
            public void InsertPicture(string book, string picturePath, float width, float hight)
            {
                object miss = System.Reflection.Missing.Value;
                object oStart = book;
                Object linkToFile = false;       //图片是否为外部链接
                Object saveWithDocument = true;  //图片是否随文档一起保存 
                object range = wordDoc.Books.get_Item(ref oStart).Range;//图片插入位置
                wordDoc.InlineShapes.AddPicture(picturePath, ref linkToFile, ref saveWithDocument, ref range);
                wordDoc.Application.ActiveDocument.InlineShapes[1].Width = width;   //设置图片宽度
                wordDoc.Application.ActiveDocument.InlineShapes[1].Height = hight;  //设置图片高度
            }            //插入一段文字,text为文字内容
            public void InsertText(string book, string text)
            {
                object oStart = book;
                object range = wordDoc.Books.get_Item(ref oStart).Range;
                Paragraph wp = wordDoc.Content.Paragraphs.Add(ref range);
                wp.Format.SpaceBefore = 6;
                wp.Range.Text = text;
                wp.Format.SpaceAfter = 24;
                wp.Range.InsertParagraphAfter();
                wordDoc.Paragraphs.Last.Range.Text = " ";
            }            // 杀掉winword.exe进程
            public void killWinWordProcess()
            {
                System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("WINWORD");
                foreach (System.Diagnostics.Process process in processes)
                {
                    bool b = process.MainWindowTitle == "";
                    if (process.MainWindowTitle == "")
                    {
                        process.Kill();
                    }
                }
            }
        }
        public Formht()
        {
            InitializeComponent();
        }        private void button1_Click(object sender, EventArgs e)
        {   //打开借据合同并向合同中添加信息
            string TemPath = @"F:\学习\soarto要求\offce小应用\word模版\借据.docx";
            Report report = new Report();         
            report.CreateNewDocument(TemPath); //模板路径
            //关闭当前窗口
            this.Close();
        }