- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 255
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-25
|
¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-12-23 14:05 ½s¿è
©Ò¥H¡A©p¨Ã«DnÅý¤å¦r¨Ì¾ÚWORDªí®æ¤º®e´«¦æ
¨º´N³]©wEXCEL¦Û°Ê´«¦C- Sub WriteWordTb()
- Dim Tb As Table, Ar()
- Set Wd = CreateObject("Word.Application") '³Ð«ØWORDµ{¦¡ª«¥ó
- Cells.Clear '²MªÅ¤u§@ªí¤º®e
- With Wd 'Ãö©óWORDµ{¦¡ª«¥ó
- With .Documents.Open(ThisWorkbook.Path & "\1.doc") '¶}±Ò«ü©wªºÀÉ®×
- For Each Tb In .tables 'doc¤å¥ó¤¤ªº¨CÓTable
- For i = 1 To Tb.Rows.Count
- For j = 1 To Tb.Columns.Count
- For s = 0 To Tb.Cell(i, j).Range.Sentences.Count - 1
- ReDim Preserve Ar(s)
- Ar(s) = Tb.Cell(i, j).Range.Sentences(s + 1)
- Next
- mystr = Join(Ar, Chr(10))
- With Cells(i, j)
- .Value = mystr
- .WrapText = True
- End With
- Erase Ar
- Next
- Next
- Next
- End With
- .Quit 'Ãö³¬µ{¦¡
- End With
- End Sub
½Æ»s¥N½X |
|