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

[µo°Ý] ¦p¦óVBA¤£«ü©w³nÅé¶}±Ò¯S©wÀÉ®×

[µo°Ý] ¦p¦óVBA¤£«ü©w³nÅé¶}±Ò¯S©wÀÉ®×

¤§©Ò¥H­n³o¼Ë°Ý¬O¦]¬°,¤U­zµ{¦¡¤¤«ü©w"C:\Program Files\Adobe\Reader 8.0\Reader\AcroRD32.exe"
¨Ó¶}±ÒPDFÀÉ®×,¦ý¬O¦¹excel Àɮ׬O©ñ¦b¤½¥Î¸ê®Æ§¨¤¤,¶}Àɪº¤H¥¼¥²¨Ï¥Îªº³nÅé©Î¬O¸ô®|·|¬OReader 8.0,
¦³¥i¯à¬O9.0,¦³¥i¯à¸ô®|¤£¬OC:\........

©Ò¥H¤~·Q¸ß°Ý¬O§_¦³¤è¦¡¥uµ¹Àɮ׸ô®|,¦Ü©ó¶}ÀɳnÅ骺¸ô®|ºØÃþ¨Ìuser¥»¨­¹q¸£¨Ó¨M©w´N¦æ

Private Sub CommandButton1_Click()
Shell "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRD32.exe \\fileserver\PUB\QA\11 SIP\SIP\QCS001-MT1097X.pdf", vbNormalFocus
End Sub

¦^´_ 1# morris_lth
try this
ActiveWorkbook.FollowHyperlink "\\fileserver\PUB\QA\11 SIP\SIP\QCS001-MT1097X.pdf"
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

  1. #If VBA7 Then
  2.   Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteW" (ByVal hWnd As LongPtr, ByVal lpOperation As LongPtr, ByVal lpFile As LongPtr, ByVal lpParameters As LongPtr, Optional ByVal lpDirectory As LongPtr = 0^, Optional ByVal nShowCmd As ShowCM = 1) As Long
  3. #Else
  4.   Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteW" (ByVal hWnd As Long, ByVal lpOperation As Long, ByVal lpFile As Long, ByVal lpParameters As Long, Optional ByVal lpDirectory As Long=0, Optional ByVal nShowCmd As ShowCM = 1) As Long
  5. #End If

  6. Public Enum ShowCM
  7.   SW_SHOWNORMAL = 1&
  8.   SW_SHOWMINIMIZED = 2&
  9.   SW_SHOWMAXIMIZED = 3&
  10.   SW_SHOWNOACTIVATE = 4&
  11.   SW_SHOW = 5&
  12.   SW_SHOWMINNOACTIVE = 7&
  13.   SW_SHOWNA = 8&
  14.   SW_SHOWDEFAULT = 10&
  15. End Enum


  16. Public Function ShellOpenFile(ByVal FileName As String, Optional ByVal ShowMode As ShowCM = 1)
  17.   If Len(FileName) Then
  18.     ShellOpenFile = ShellExecute(Application.hWnd, StrPtr("open"), StrPtr(FileName), 0, , ShowMode)
  19.   End If
  20. End Function

  21. Sub Test()
  22.   ShellOpenFile "\\fileserver\PUB\QA\11 SIP\SIP\QCS001-MT1097X.pdf" '¥i¥H¬O¨ä¥¦ªº¤å¥ó¦W¡A¥u­n¨t²Î¯à°÷ÃѧOªº¤å¥óÃþ«¬¡A³£·|¦Û°Ê¥HWindowsÀq»{µ{¦¡¶}±Ò«ü©wªº¤å¥ó¡C¤ñ¦p«ü©wªº¬O.TXT¤å¥ó¡A±N·|¦Û°Ê¥HNotepad.exe¶}±Ò
  23.   ShellOpenFile "https://www.facebook.com/profile.php?id=100010420125898", SW_SHOWMAXIMIZED  '¶}±Òºô­¶
  24.   ShellOpenFile "MailTo:[email protected]" 'µo°eEmail¨ì«ü©wªº¶l½c¦a§}
  25. End Sub
½Æ»s¥N½X
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥h­þ¡H

TOP

¸Õ¸Õ¡G
VBA.CreateObject("WScript.Shell").Run """\\fileserver\PUB\QA\11 SIP\SIP\QCS001-MT1097X.pdf"""

TOP

ÁÂÁÂ,¤j®aªº¤èªk³£¤£¿ù

TOP

        ÀR«ä¦Û¦b : ¡i¬O§_µo´§¤F¨}¯à¡H¡j¤H¶¡¹Ø©R¦]¬°µu¼È¡A¤~§óÅã±o¬Ã¶Q¡CÃø±o¨Ó¤@½ë¤H¶¡¡AÀ³°Ý¬O§_¬°¤H¶¡µo´§¤F¦Û¤vªº¨}¯à¡A¦Ó¤£­n¤@¨ý¨Dªø¹Ø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD