응용프로그램(메모장)실행
작성자 정보
- 모아 작성
- 작성일
컨텐츠 정보
- 5 조회
- 0 추천
- 0 비추천
- 목록
본문
응용프로그램(메모장)실행
아래 메크로는 메모장을 실행한후 내용을 작성을 하고 저장하고 닫는 기능을 한다.
Sub 메모장실행()
'
' 응용프로그램(메모장)을 실행하고 응용프로램에게 특정명령을 전송한다.
'
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists("C:\WINDOWS\NOTEPAD.EXE") = False Then
MsgBox "메모장이 없습니다."
Exit Sub
End If
Dim ReturnValue
' ReturnValue = Shell("C:\WINDOWS\NOTEPAD.EXE", vbNormalFocus) ' Run Notepad
ReturnValue = Shell("C:\WINDOWS\NOTEPAD.EXE c:\문서\temp\sample.txt", vbNormalFocus) ' Run Notepad
AppActivate ReturnValue 'Activate the Notepad.
SendKeys "^a" 'Send CTRL+a 전체선택
SendKeys "{DELETE}" 'Send DELETE to Notepad
SendKeys "12345=", True ' Send keystrokes to Notepad
SendKeys "{+}", True ' Send plus sign to Notepad
SendKeys "{%}", True ' Send percent sign to Notepad
SendKeys "{ENTER}", True ' Send ENTER to Notepad
SendKeys "67890", True ' Send keystrokes to Notepad
SendKeys "{ENTER}", True ' Send ENTER to Notepad
' SendKeys "^a" 'Send CTRL+a 전체선택
' SendKeys "^c" 'Send CTRL+c 클립보드에 복사하기
' SendKeys "^v" 'Send CTRL+v 클립보드에 있는내용 붙여넣기
SendKeys "^s" 'Send CTTRL+s 저장
' SendKeys "+a" 'Send SHIFT+a
SendKeys "%{F4}", True ' Send ALT+F4 to close Notepad.
AppActivate ThisWorkbook.Application.Caption
End Sub
[출처] 엑셀매크로(VBA) - 응용프로그램(메모장)실행|작성자 천칭
|
포인트 선물 선물명단 선물하기
최소 5P ~ 최대 100000000P 까지 가능합니다.
로그인 후 선물하실 수 있습니다.
선물 받은 내용이 없습니다.
관련자료

-
등록일 02.23
-
등록일 02.23
-
등록일 02.23
-
등록일 02.23