ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Ū¨úªí®æ

[µo°Ý] Ū¨úªí®æ

¥»©«³Ì«á¥Ñ kannas ©ó 2010-12-2 21:35 ½s¿è

½Ð°Ý¦p¦ó¥ÎExcel ªºVB¡A¼g¦¨Åª¨úwordªºªí®æ¡A
¨Ã§â¥¦ÂàÅܦbExcel¤W­±¡A®æ¦¡­n¸òword¤Wªº¤@¼Ë¡C

§A¥i¥H参¦Ò¤U这¨½:
http://forum.twbts.com/viewthrea ... &page=1#pid9388

´£问题³Ì¦n¦³ªþ¥ó.

TOP

§Ú«üªº¬Oµ{¦¡°õ¦æ®É¡A
·|¦Û°ÊŪ¨ú«ü©w¸ô®|ªºwordÀɮסA
¨Ã§âÀÉ®×¼g¦^Excel¤W­±¡A
¦ý§Ú§Æ±æ¥Lªº®æ¦¡¤£·|ÅÜ¡C

¦³ÂI¹³¬O
http://tw.myblog.yahoo.com/jw!_DIL5waFHwVKfL8odMZ4urti/article?mid=1617&prev=1572&next=1615&l=f&fid=16
³o­Óªºµ{¦¡
¦ý¬O§Ú¥Î³o­Ó§Ë¡A®æ¦¡·|ÅÜ¡AÁöµM¦ì¤l¤@¼Ë¡A¦ý®æ¦¡«o¨S¤F¡C

TOP

§Ú«üªº¬Oµ{¦¡°õ¦æ®É¡A
·|¦Û°ÊŪ¨ú«ü©w¸ô®|ªºwordÀɮסA
¨Ã§âÀÉ®×¼g¦^Excel¤W­±¡A
¦ý§Ú§Æ±æ¥Lªº®æ¦¡¤£·|ÅÜ ...
kannas µoªí©ó 2010-12-1 01:05



   ¤@­Ó«D±`Ãiªº¤èªk
copy and paste....
  1. Sub dsa()
  2.        Dim Wd   'Word
  3.        Dim Dc   '¤å¥ó
  4.        Dim Tb   '¤ºªí
  5.        Dim i, j    '©w¦ì
  6.    
  7.            Sheet1.UsedRange.EntireRow.Delete    'Excel Sheet1 ²Mªí
  8.            Set Wd = CreateObject("Word.Application")
  9.            Dim RgR As Range
  10.            Set Dc = Wd.Documents.Open("C:\temp\1.DOC ") 'ÀɦW
  11.            Wd.Visible = True
  12.            With Wd.Selection.Find
  13.                 .Text = "^l"
  14.                 .Replacement.Text = " "
  15.             End With
  16.             Wd.Selection.Find.Execute Replace:=2
  17.             With Wd.Selection.Find
  18.                 .Text = "^p"
  19.                 .Replacement.Text = " "
  20.             End With
  21.             Wd.Selection.Find.Execute Replace:=2
  22.            For Each Tb In Dc.tables
  23.                Set RgR = Sheet1.UsedRange.EntireRow.Offset(Sheet1.UsedRange.Rows.Count + 1, 0).Cells(1)
  24.                Tb.Range.Copy
  25.                RgR.Select
  26.                ActiveSheet.PasteSpecial Format:="HTML"
  27.            Next
  28.          
  29.            Wd.Quit
  30. End Sub
½Æ»s¥N½X
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

¥»©«³Ì«á¥Ñ kannas ©ó 2010-12-17 11:05 ½s¿è

§Úªºªí®æ¤W¦³¨Ç®æ¤º¦³¤À¦æ
§Ú·QÅý¥L¦bExcel¤º¥u¦b¤@­Ó®æ·Q¥ÎChr¨Ó¤À¦æ

¤W­±¨º­Óµ{¦¡¥L·|§ó§ï¨ìwordªº¸ê®Æ¡AÅܱo¨C¦¸³£·|°Ý¬O§_¦swordÀÉ®×

¥i¥Hªº¸Ü¥i¥H¸ÑÄÀ¨C­Óµ{¦¡ªº·N«ä¶Ü?
¦]¬°§Ú¦³¨Ç¬Ý¤£À´¡A§Ú·Q¤F¸Ñ¨C¨BÆJªº·N«ä¡C
·PÁ¡C

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-12-17 15:54 ½s¿è

¦^´_ 5# kannas
  1. Sub WriteWordTb()
  2. Dim Tb As Table, Ar()
  3. Set Wd = CreateObject("Word.Application") '³Ð«ØWORDµ{¦¡ª«¥ó
  4. Cells.Clear '²MªÅ¤u§@ªí¤º®e
  5. With Wd 'Ãö©óWORDµ{¦¡ª«¥ó
  6.   With .Documents.Open(ThisWorkbook.Path & "\1.doc") '¶}±Ò«ü©wªºÀÉ®×
  7.     For Each Tb In .tables 'doc¤å¥ó¤¤ªº¨C­ÓTable
  8.     For i = 1 To Tb.Rows.Count
  9.         For j = 1 To Tb.Columns.Count
  10.            For s = 0 To Tb.Cell(i, j).Range.Sentences.Count - 1
  11.               ReDim Preserve Ar(s)
  12.               Ar(s) = Tb.Cell(i, j).Range.Sentences(s + 1)
  13.            Next
  14.          mystr = Join(Ar, Chr(10))
  15.         Cells(i, j) = mystr
  16.         Erase Ar
  17.         Next
  18.     Next
  19.     Next
  20.   End With
  21.   .Quit 'Ãö³¬µ{¦¡
  22. End With
  23. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 6# Hsieh


    ³o­Óµ{¦¡µLªk°õ¦æ­C
   ¥¦Åã¥Ü½sĶ¿ù»~:  ¨Ï¥ÎªÌ¦Û­q«¬ºA©|¥¼©w¸q

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-12-23 14:19 ½s¿è

]¦^´_ 7# kannas


    ¶·¤Þ¥Î¶µ¥Ø
MicroSoft Word 12.0 Object Library

©Î¨ú®øTbÅܼƫŧi
  1. Sub WriteWordTb()
  2. Dim Ar()
  3. Set Wd = CreateObject("Word.Application") '³Ð«ØWORDµ{¦¡ª«¥ó
  4. Cells.Clear '²MªÅ¤u§@ªí¤º®e
  5. With Wd 'Ãö©óWORDµ{¦¡ª«¥ó
  6.   With .Documents.Open(ThisWorkbook.Path & "\1.doc") '¶}±Ò«ü©wªºÀÉ®×
  7.     For Each Tb In .tables 'doc¤å¥ó¤¤ªº¨C­ÓTable
  8.     For i = 1 To Tb.Rows.Count
  9.         For j = 1 To Tb.Columns.Count
  10.            For s = 0 To Tb.Cell(i, j).Range.Sentences.Count - 1
  11.               ReDim Preserve Ar(s)
  12.               Ar(s) = Tb.Cell(i, j).Range.Sentences(s + 1)
  13.            Next
  14.          mystr = Join(Ar, Chr(10))
  15.         Cells(i, j) = mystr
  16.         Erase Ar
  17.         Next
  18.     Next
  19.     Next
  20.   End With
  21.   .Quit 'Ãö³¬µ{¦¡
  22. End With
  23. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 8# Hsieh


   ½Ð°Ý§Ú¥Î¤W­±¨º­Óµ{¦¡«á¡A¦]¬°¦³¨Çªí®æ¤º¥Lªº¦r¼Æ¦³ÂI¤p¦h¡A
  ¥Î¦Û°Ê½Õ¾ãÄæ¼eªº¸Ü¡A¾ã­Óªí®æ´N·|¯}Ãa±¼¡AÅܱo«Ü¼e¡C
  ¹³¬O¦³¤@¦ê¦r¡AÂI¤U®æ¤l¤º¥L·|Åã¥Ü¥þ³¡ªº¦r¡A¦pªG¨SÂI´N¥uÅã¥Üªí®æ¤j¤p©Ò¯àÅã¥Üªº¦r¼Æ¡A¨ä¥L«h¤£Åã¥Ü¡A
  ¥i¥H§â¥¦§Ë¦¨¹³¬O¦Û°Ê´«¦æ¶Ü?
   Åýªí®æ¬Ý°_¨Ó¤£·|«Ü©_©Ç?

   °Ý¤F³o»ò¦h  ¯u¬O³Â·Ð¦U¦ì¤F  ÁÂÁÂ!!!

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-12-23 14:05 ½s¿è

©Ò¥H¡A©p¨Ã«D­nÅý¤å¦r¨Ì¾ÚWORDªí®æ¤º®e´«¦æ
¨º´N³]©wEXCEL¦Û°Ê´«¦C
  1. Sub WriteWordTb()
  2. Dim Tb As Table, Ar()
  3. Set Wd = CreateObject("Word.Application") '³Ð«ØWORDµ{¦¡ª«¥ó
  4. Cells.Clear '²MªÅ¤u§@ªí¤º®e
  5. With Wd 'Ãö©óWORDµ{¦¡ª«¥ó
  6.   With .Documents.Open(ThisWorkbook.Path & "\1.doc") '¶}±Ò«ü©wªºÀÉ®×
  7.     For Each Tb In .tables 'doc¤å¥ó¤¤ªº¨C­ÓTable
  8.     For i = 1 To Tb.Rows.Count
  9.         For j = 1 To Tb.Columns.Count
  10.            For s = 0 To Tb.Cell(i, j).Range.Sentences.Count - 1
  11.               ReDim Preserve Ar(s)
  12.               Ar(s) = Tb.Cell(i, j).Range.Sentences(s + 1)
  13.            Next
  14.          mystr = Join(Ar, Chr(10))
  15.         With Cells(i, j)
  16.         .Value = mystr
  17.         .WrapText = True
  18.         End With
  19.         Erase Ar
  20.         Next
  21.     Next
  22.     Next
  23.   End With
  24.   .Quit 'Ãö³¬µ{¦¡
  25. End With
  26. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¥Í®ð¡A´N¬O®³§O¤Hªº¹L¿ù¨ÓÃg»@¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD