|
获取和写入两个方向是不同的,获取时有chr(13),写入时只需chr(10)就可以了。
- Sub ffd()
- Dim mydata As Object
- Dim arr(2, 2) As String '测试用二维数组
- On Error Resume Next
- Set mydata = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
- ActiveDocument.Tables(1).Range.Select
- Selection.Delete '清空测试表格内容
- For i = 0 To 2
- For j = 0 To 2
- n = n + 1
- arr(i, j) = n
- Next
- Next
- For i = 0 To UBound(arr, 2)
- For j = 0 To 2
- strA = strA & arr(i, j) & Chr(9)
- Next
- strA = strA & Chr(10)
- Next
- mydata.SetText strA
- mydata.PutInClipboard
- MsgBox strA ’奇怪,这个若是去掉,粘贴会失败?
- ActiveDocument.Tables(1).Range.Paste
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|