- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
[µo°Ý] ºô¸ôªÚ¾F¤¤ ì¥D¾÷¸ô®|À³¦p¦ó¤U»yªk?
¦V¤j¤j¥ý¶įD±Ï:
쥻¦b¦Û¤v¥D¾÷¥ÑA1.xls ªí³æ¶}±ÒA2.xls ¨S°ÝÃD
Private Sub UserForm_Initialize()
Dim Path1, str1, str2 As String
Path1 = Application.ActiveWorkbook.Path
Set wb = ActiveWorkbook
wb.Activate
ChDrive Split(Path1, ":")(0)
ChDir Path1
Dim FileName As Variant
Dim xlfileName As String
FileName = Path1 & "\" & "A2.xls"
xlfileName = Dir(FileName)
If IsOpen(xlfileName) Then
Workbooks(xlfileName).Activate
Set wb1 = Workbooks(xlfileName)
Else
Set wb1 = Workbooks.Open(FileName, True, False)
End If
wb.Activate
End Sub
¦]±¡¶Õ»Ýn»Ý±N¦¹A1.xls ¸m¤Jºô¸ôªÚ¾F¤¤ ¥Ñ²Ä¤G®à¹q¶}A1.xls
µ²ªG §ì¤£¨ì A2.xls
§Úª¾¹D¬Opath1¤§°ÝÃD
À³¦p¦ó³]©w FileName = " ¥D¾÷¤@" ªº Path1 & "\" & "A2.xls" ????
·íµM¥H¤U©Ò¶}ªº WordÀÉ¥ç¦bºô¸ôªÚ¾F¤¤ ¸ô®|À³¦p¦ó¤U»yªk
Set appWD = CreateObject("Word.Application")
With appWD
.Visible = True
.ChangeFileOpenDirectory Path1 & "\"
.Documents.Open FileName:="A4¦X¨Ö¦C¦L(3X5).doc"
.WindowState = wdWindowStateNormal
.Run "A4¦X¨Ö¦C¦L(3X5)!upPrint1" '°õ¦æ³o¥¨¶°
' .Quit SaveChanges:=False 'Ãö³¬Word
End With
ÁÂÁ¨ó§U ¦³ÂI¤ß«æ ¸U¤À·P¿E
Set appWD = Nothing
End Sub |
|