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

[µo°Ý] ¦p¦ó¦bExcel Vba¤§¤U®M¥Î¤W¦CWord Vba?

[µo°Ý] ¦p¦ó¦bExcel Vba¤§¤U®M¥Î¤W¦CWord Vba?

½Ð±Ð¦U¦ì¥ý¶i¤j¤j:
       ¥H¤U¬O§Ú¦bWord¤¤¿ý»s¥[¥H­×¥¿ ¥i¥H¦bWord¤¤¥¿±`Run
       ChangeFileOpenDirectory ActiveDocument.Path & "\"
        Documents.Open FileName:="A4-3X7.doc", ConfirmConversions:=False
    Windows("A4-3X7.doc").Activate
    With ActiveDocument.MailMerge
        .Destination = wdSendToNewDocument
        .SuppressBlankLines = True
        With .DataSource
            .FirstRecord = wdDefaultFirstRecord
            .LastRecord = wdDefaultLastRecord
        End With
        .Execute Pause:=False
    End With
    ChangeFileOpenDirectory ActiveDocument.Path & "\"
    ActiveDocument.SaveAs FileName:="®Mªí.doc", FileFormat:=wdFormatDocument, _
        LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _
        :="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
        SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
        False
    ¦p¦ó°e¥Xµ¹¦Cªí¾÷?»yªk?
    ActiveWindow.Close
¥H¤Wµ{§Ç À³¦p¦bExcel Vba¤U»yªk  °õ¦æ
1.¦bExcel ¤U¶}:"A4-3X7.doc"
2.¦bExcel Vba¤§¤U®M¥Î¤W¦CWord Vba
                  Àµ¨D¨ó§U
                 ÁÂÁÂ

¦^´_ 2# GBKEE
    ¸U¤À·P¿E
   §¹¥þ¸Ñ¨M
    ÁÂÁÂ

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-1-20 08:03 ½s¿è

¦^´_ 1# yangjie
¸Õ¸Õ¬Ý
ExcelªºVBA
  1. Option Explicit
  2. Public appWD As Object
  3. Sub Ex()
  4.     Set appWD = CreateObject("Word.Application")
  5.     With appWD
  6.         .Visible = True
  7.         .ChangeFileOpenDirectory "D:\"
  8.         .Documents.Open Filename:="Doc1.doc"
  9.         .Run "Doc1!ThisDocument.ex1" '°õ¦æ³o¥¨¶°
  10.         '¦pThisDocument ¤¤¦³ Sub Document_Open() ¥ç·|¦Û°Ê°õ¦æ
  11.         '.Quit      'Ãö³¬Word
  12.     End With
  13.     'Set appWD = Nothing
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD