问题已解决,现附上修改后的代码,欢迎指导!
Close Databasea
Clear all
cPath=Addbs(Justpath(Sys(16)))
Set Default to (cPath)
Create table rzsfb(房号c(4),业主姓名 C(10),面积c(10),月物业费c(10),年物业费c(10),装修管理费c(10),合计金额 N(8,1))
Doc=Createobject ("word.application”)
For i=1 To Adir (aDocx,"*.docx)
wd=Doc.Documents.Open (cPath+aDocx[i,1])
For j=1 To wd.paragraphs.Count-1 step 9
a=wd.paragraphs (j).Range.Text
b=wd.paragraphs (j+1).Range.Text
c=wd.paragraphs (j+2).Range.Text
d=wd.paragraphs(j+3).Range.Text
e=wd.paragraphs(j+4).Range.Text
f=wd.paragraphs(j+5).Range.Text
g=wd.paragraphs(j+6).Range.Text
h=wd.paragraphs (j+7).Range.Text
k=wd.paragraphs (j+8).Range.Text
Insert Into rzsfb Values(;
STREXTRACT(d,“楼",”室”),;
STREXTRACT (b,":",” “),;
STREXTRACT(d,“:",”平方米”),;
STREXTRACT(e,“费",“元",2),;
STREXTRACT(e,"小计“,“元"),;
STREXTRACT(f,”小计“,“元“),;
VAL(STREXTRACT(h,“¥“,”元”)))
Endfor
wd.Close
Endfor
Doc.Quit
Select * From rzsfb
Copy To Myexcel Type XL5
[此贴子已经被作者于2024-5-7 07:25编辑过]