VBA代码如何改写为VFP代码?请高手赐教!
Sub 导出题库()
Set doc = CreateObject("word.application") '创建Word对象
Set wd = doc.Documents.Add
With ThisWorkbook.Worksheets(2)
rrow = .Range("a65536").End(3).Row
For i = 2 To rrow
arr = Split(.Cells(i, 3), "|")
If UBound(arr) > 1 Then
strr = .Cells(i, 1) & "、" & .Cells(i, 2).Value & vbCrLf & _
"A." & arr(1) & "B." & arr(2) & "C." & arr(3) & "D." & arr(4) & vbCrLf & "标准答案:" & .Cells(i, 4)
With doc.Selection
.TypeText strr
.TypeParagraph
End With
Else
End If
Next
wd.SaveAs ThisWorkbook.Path & "\例子.docx"
End with
End sub