在EXCEL中打开WORD.docx_第1页
在EXCEL中打开WORD.docx_第2页
在EXCEL中打开WORD.docx_第3页
在EXCEL中打开WORD.docx_第4页
在EXCEL中打开WORD.docx_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

在EXCEL中打开WORD文档在EXCEL中打开WORD文档 , 并将 word 文档中的表中的数据 复制到 EXCEL表的单元格中。/thread-1224805-1-1.html在某一 Microsoft Office 应用程序中控制其他 Microsoft Office 应用程序如果要在某一 Microsoft Office 应用程序中运行处理其他 Microsoft Office 应用程序中对象的代码,请按下列步骤进行。1、在“引用”对话框(“工具”菜单)中设置对其他应用程序的类型库的引用。进行该操作之后,对象、属性和方法将显示在“对象浏览器”中,并且在编译时将检查语法。还可以获取这些对象、属性和方法的快捷帮助。2、以特定的类型声明对象变量,该对象变量将引用其他应用程序中的对象。请确保用提供对象的应用程序的名称限定了每一个类型。例如,下列语句声明了指向 Microsoft Word 文档的变量和另一个指向 Microsoft Excel 工作簿的变量。Dim appWD As Word.Application, wbXL As Excel.Workbook注释 如果希望代码早被绑定,则必须遵循前面的步骤。3、使用要在其他应用程序中处理的对象的 OLE 程序标识符作为参数来调用 CreateObject 函数,如下例所示。如果要查看相应的应用程序会话,请将 Visible 属性设置为 True。Dim appWD As Word.ApplicationSet appWD = CreateObject(Word.Application)appWd.Visible = True4、对包含在变量中的对象应用属性和方法。例如,下述指令创建新的 Word 文档。Dim appWD As Word.ApplicationSet appWD = CreateObject(Word.Application)appWD.Documents.Add5、对相应的应用程序处理结束后,用 Quit 方法将其关闭,如下例所示。appWd.Quitappwd.Documents.Open FileName:=2005年度政治题.doc/Sub 打开WORD文档()Workbooks.Open Filename:=D:我的文档桌面中国联通河南省XX分公司DT、CQT覆盖性能指标.xls Range(A1:F38).SelectDim appWD As Word.Application, doc As ObjectSet appWD = CreateObject(Word.Application)appWD.Visible = TrueappWD.Documents.Open Filename:=D:我的文档桌面鼎利报表.docappWd.QuitEnd Sub/Sub 打开WORD文档()Workbooks.Open Filename:=D:我的文档桌面中国联通河南省XX分公司DT、CQT覆盖性能指标.xls Range(A1:F38).SelectDim appWD As Word.Application, doc As ObjectSet appWD = CreateObject(Word.Application)appWD.Visible = TrueappWD.Documents.Open Filename:=D:我的文档桌面鼎利报表.doctmpstr = ActiveDocument.Tables(1).Cell(8, 2).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(X4) = tmpstrtmpstr = ActiveDocument.Tables(1).Cell(7, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(Y4) = tmpstrtmpstr = ActiveDocument.Tables(1).Cell(6, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(Z4) = tmpstrtmpstr = ActiveDocument.Tables(1).Cell(4, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AA4) = tmpstrtmpstr = ActiveDocument.Tables(1).Cell(5, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AA5) = tmpstrtmpstr = ActiveDocument.Tables(1).Cell(3, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AB4) = tmpstrtmpstr = ActiveDocument.Tables(1).Cell(2, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AC4) = tmpstrtmpstr = ActiveDocument.Tables(1).Cell(4, 5).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AD4) = tmpstr上面是totaleciotmpstr = ActiveDocument.Tables(2).Cell(10, 2).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AE4) = tmpstrtmpstr = ActiveDocument.Tables(2).Cell(9, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AF4) = tmpstrtmpstr = ActiveDocument.Tables(2).Cell(8, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AG4) = tmpstrtmpstr = ActiveDocument.Tables(2).Cell(7, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AH4) = tmpstrtmpstr = ActiveDocument.Tables(2).Cell(6, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AI4) = tmpstrtmpstr = ActiveDocument.Tables(2).Cell(5, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AJ4) = tmpstrtmpstr = ActiveDocument.Tables(2).Cell(4, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AK4) = tmpstrtmpstr = ActiveDocument.Tables(2).Cell(3, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AL4) = tmpstrtmpstr = ActiveDocument.Tables(2).Cell(2, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(AM4) = tmpstr上面是totalrscptmpstr = ActiveDocument.Tables(3).Cell(7, 2).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(D4) = tmpstrtmpstr = ActiveDocument.Tables(3).Cell(6, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(E4) = tmpstrtmpstr = ActiveDocument.Tables(3).Cell(5, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(F4) = tmpstrtmpstr = ActiveDocument.Tables(3).Cell(4, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(G4) = tmpstrtmpstr = ActiveDocument.Tables(3).Cell(3, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(H4) = tmpstrtmpstr = ActiveDocument.Tables(3).Cell(2, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(I4) = tmpstr上面是RXLEVELSUBtmpstr = ActiveDocument.Tables(4).Cell(11, 2).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(O4) = tmpstrtmpstr = ActiveDocument.Tables(4).Cell(10, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(P4) = tmpstrtmpstr = ActiveDocument.Tables(4).Cell(9, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(Q4) = tmpstrtmpstr = ActiveDocument.Tables(4).Cell(8, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(R4) = tmpstrtmpstr = ActiveDocument.Tables(4).Cell(7, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(S4) = tmpstrtmpstr = ActiveDocument.Tables(4).Cell(6, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(T4) = tmpstrtmpstr = ActiveDocument.Tables(4).Cell(5, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(U4) = tmpstrtmpstr = ActiveDocument.Tables(4).Cell(4, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(V4) = tmpstrtmpstr = ActiveDocument.Tables(4).Cell(3, 4).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr, ) - 2)MsgBox tmpstrWindows(中国联通河南省XX分公司DT、CQT覆盖性能指标.xls).ActivateRange(W4) = tmpstr上面是RXQULSUBtmpstr = ActiveDocument.Tables(5).Cell(7, 2).Range.Texttmpstr = Left(tmpstr, InStr(1, tmpstr

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论