请教“狼行天下”老师:用VB如何把WORD格式文件中的数据到如到EXCEL中 现在是有几个数据根式都相同的WORD格式的文件,如何才能实现把WORD里面的数据导入到EXCEL中去!谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 传个附件上来.或者发送到[email protected] 谢谢老师!CSDN好像不能传附件哦!我发邮箱吧! 打开excel 文件VBE界面,新建模块,引用WORD对象,执行下面的代码:Sub macro1()Dim wd As New Word.Application, doc As New Word.Document, i As Long, t As Word.Tablewd.Visible = TrueSet doc = wd.Documents.Open(ThisWorkbook.Path & "\a.doc")Set t = doc.Tables(1)[a2].Resize(1, 11) = Array(t.Cell(1, 2), t.Cell(1, 4), Mid(t.Cell(1, 5), 7, 7), t.Cell(2, 2), t.Cell(2, 4), t.Cell(2, 6), t.Cell(3, 2), t.Cell(3, 4), t.Cell(3, 6), t.Cell(4, 2), t.Cell(4, 4))[2:2].Replace "", ""t.Cell(1, 6).Selectwd.Selection.MoveRight Unit:=wdCellwd.Selection.Copy[l2].SelectActiveSheet.Pastedoc.Closewd.QuitEnd Sub WINSOCK发送utf-8文本 VB中如何限制控件允许用鼠标进行缩放的最大值和最小值 高分求助!MSHFlextGrid的删除问题 有关TreeView控件的问题!!!!!! 不会吧,装了我的程序后,扫描仪无法正常使用?? 请问如何在程序运行时根据分辨率等比例调整窗体,控件和字体的大小,使得在任何分辨率下均满屏显示 删除随机文件的一条纪录?怎么做方便? 如何实现多个查询在datagrid中显示 VB是不是没有C/C++等要好呢? 十万火急,ic卡管理机软件设计的v.b实现方法 VB串口通讯(MSComm) VB类的使用问题
谢谢老师!CSDN好像不能传附件哦!我发邮箱吧!
Dim wd As New Word.Application, doc As New Word.Document, i As Long, t As Word.Table
wd.Visible = True
Set doc = wd.Documents.Open(ThisWorkbook.Path & "\a.doc")
Set t = doc.Tables(1)
[a2].Resize(1, 11) = Array(t.Cell(1, 2), t.Cell(1, 4), Mid(t.Cell(1, 5), 7, 7), t.Cell(2, 2), t.Cell(2, 4), t.Cell(2, 6), t.Cell(3, 2), t.Cell(3, 4), t.Cell(3, 6), t.Cell(4, 2), t.Cell(4, 4))
[2:2].Replace "", ""
t.Cell(1, 6).Select
wd.Selection.MoveRight Unit:=wdCell
wd.Selection.Copy
[l2].Select
ActiveSheet.Paste
doc.Close
wd.Quit
End Sub