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

[¤À¨É] ½Ð°Ýprint screenªº¥N½X¦p¦ó¼g?? (API¹B¥Î)

[¤À¨É] ½Ð°Ýprint screenªº¥N½X¦p¦ó¼g?? (API¹B¥Î)

§Úªº­n¨D¬O
¥´¶}Àɮ׮ɧYÂ^¨ú¤@±i«Ì¹õ¹Ï
(ºI«Ì«e¶·¥ý±NEXCELµøµ¡ÁY¦Ü³Ì¤p¥HÅã²{­nºI«Ìªºµe­±)
¨Ã±N¨ä¶K¨ìA1
¥H«á¨C¤p®ÉÂ^¨ú¤@±i«Ì¹õ¹Ï
(ºI«Ì«e¤@¼Ë¶·¥ý±NEXCELµøµ¡ÁY¦Ü³Ì¤p
¤U±i¹Ï«h¶K¦Ü³Ì¾A¦X¤§°ª«×¤§¦æ(ºò±µ«e¤@±i¹Ï)
¨Ò¦p²Ä¤@±i¹Ï¶Kº¡A1:K20
²Ä¤G±i¶K¨ìA21
¤£ª¾¦p¦ó¹F¦¨
Emily_Li ¦^ÂÐ
  1. Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal _
  2. bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
  3. Private Const VK_KEYUP = &H2
  4. Private Const VK_SNAPSHOT = &H2C
  5. Private Const VK_MENU = &H12
  6. Dim ws As Worksheet

  7. Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" _
  8. (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

  9. Global Const SW_MAXIMIZE = 3
  10. Global Const SW_SHOWNORMAL = 1
  11. Global Const SW_SHOWMINIMIZED = 2


  12. Sub Print_Screen()

  13. keybd_event VK_MENU, 0, 0, 0
  14. DoEvents

  15. keybd_event VK_SNAPSHOT, 0, 0, 0
  16. DoEvents

  17. keybd_event VK_SNAPSHOT, 0, VK_KEYUP, 0
  18. DoEvents

  19. keybd_event VK_MENU, 0, VK_KEYUP, 0
  20. DoEvents
  21. Set ws = ActiveSheet
  22. ws.Paste Destination:=ws.Range("A1")
  23. DoEvents
  24. End Sub
½Æ»s¥N½X
µ²ªG»P­n¨D¦³¸¨®t¤º  
³o¥N½X¬OÂ^¨úexcelªºµe­±
§Úªº­n¨D¬O
¥´¶}Àɮ׮ɧYÂ^¨ú¤@±i«Ì¹õ¹Ï
(ºI«Ì«e¶·¥ý±NEXCELµøµ¡ÁY¦Ü³Ì¤p¥HÅã²{­nºI«Ìªºµe­±)
¥ç§Y¬OÂ^¨ú¥t¤@­Ó¥¿©óµøµ¡³Ì¤W¼h°õ¦æªºµ{¦¡µe­±¦Ó¤£¬OÂ^¨úexcelªºµe­±
¨Ã±N¨ä¶K¨ìA1
¥H«á¨C¤p®ÉÂ^¨ú¤@±i«Ì¹õ¹Ï
(ºI«Ì«e¤@¼Ë¶·¥ý±NEXCELµøµ¡ÁY¦Ü³Ì¤p)
¤£ª¾¯à§_§ï§ï
hsieh¦^ÂÐ:
¨Ì¼Ëµe¸¬Äª
§Q¥ÎEmily_Li «e½úµ{¦¡½X­×§ï
  1. Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal _
  2. bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
  3. Private Const VK_KEYUP = &H2
  4. Private Const VK_SNAPSHOT = &H2C
  5. Private Const VK_MENU = &H12
  6. Dim ws As Worksheet

  7. Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" _
  8. (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

  9. Global Const SW_MAXIMIZE = 3
  10. Global Const SW_SHOWNORMAL = 1
  11. Global Const SW_SHOWMINIMIZED = 2


  12. Sub Print_Screen()

  13. keybd_event VK_MENU, 0, 0, 0
  14. DoEvents
  15. Application.WindowState = xlMinimized
  16. Application.Wait Now + TimeValue("00:00:05")
  17. keybd_event VK_SNAPSHOT, 0, 0, 0
  18. DoEvents

  19. keybd_event VK_SNAPSHOT, 0, VK_KEYUP, 0
  20. DoEvents

  21. keybd_event VK_MENU, 0, VK_KEYUP, 0
  22. DoEvents
  23. Application.WindowState = xlMaximized
  24. Set ws = ActiveWorkbook.ActiveSheet
  25. ws.Paste Destination:=ws.Range("A1")
  26. DoEvents
  27. Application.OnTime Now + TimeValue("01:00:00"), "Print_Screen"
  28. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

        ÀR«ä¦Û¦b : ­n§åµû§O¤H®É¡A¥ý·Q·Q¦Û¤v¬O§_§¹¬üµL¯Ê¡C
ªð¦^¦Cªí ¤W¤@¥DÃD