hur man avslutar powerpoint från tillträde

Att veta hur man avsluta ett externt program från Microsoft Office Access-program kan göra din ansökan mer dynamisk . Access är en relationsdatabas som används för mindre databaser . Microsoft Office PowerPoint ett program som används för att skapa presentationer . Båda dessa program inkluderas i Microsoft Office-paketet . Visual Basic for Applications ( VBA ) används för att automatisera rutinmässiga processer som annars måste göras manuellt . På bara några steg kan du skriva VBA- kod för att stänga PowerPoint från Access .
1
Starta Microsoft Office Access 2007 och välj ” tom databas , ” klicka på. ”Skapa ”. Klicka på ” Databas Verktyg ”och välj sedan ”Visual Basic ”.
2 .
Klicka på ” Infoga ” och välj ” Module ”.
3 .

Kopiera och klistra in följande kod på din modul .

Typ PROCESSENTRY32

dwSize As Long

cntUsage As Long

th32ProcessID As Long

th32DefaultHeapID As Long

th32ModuleID As Long

cntThreads As Long

th32ParentProcessID As Long

pcPriClassBase As Long

dwFlags As Long

szexeFile As String * 260

Sista Typ

&#039————————————– —————–

Declare Function OpenProcess Lib ” Kernel32 . dll ” ( ByVal dwDesiredAccess As Long , _

ByVal blnheritHandle As Long , ByVal dwAppProcessId As Long ) As Long

Declare Function ProcessFirst Lib ” Kernel32. dll ”Alias ” Process32First ” ( ByVal lngSnapSht As Long , _

aProcess Som PROCESSENTRY32 ) As Long

Declare Function ProcessNext Lib ” Kernel32. dll ”Alias ” Process32Next ” ( ByVal lngSnapSht As Long , _

aProcess Som PROCESSENTRY32 ) As Long

Declare Function CreateToolhelpSnapshot Lib ” Kernel32 . dwSize=Len ( aProcess )

lngSnapSht=CreateToolhelpSnapshot ( TH32CS_SNAPPROCESS , 0 )

lProcessFnd=ProcessFirst ( lngSnapSht , aProcess )

Har

iCntr=InStr (1 , aProcess. szexeFile , Chr (0 ))

strExeName=LCase $ ( Vänster $ ( aProcess. szexeFile , iCntr-1) )

WinowDirEnv=Environ ( ” Windir ” ) + ”\ ”

WinowDirEnv=LCase $ ( WinowDirEnv )

Om Right $ ( strExeName , Len ( NameProcess ))=LCase $ ( NameProcess ) Sen

AppCount=AppCount + 1

myProcess=OpenProcess ( PROCESS_TERMINATE , Falskt , aProcess . th32ProcessID )

AppTerminate=TerminateProcess ( myProcess , ExitCode )

Ring CloseHandle ( myProcess )

End If

lProcessFnd=ProcessNext ( lngSnapSht , aProcess )

Loop While lProcessFnd

Call CloseHandle ( lngSnapSht )

End If

End Sub
4 .
Klicka bredvid ” closePowerPoint ( ” Powerpnt. exe ” ) ” och tryck på ” F5 ” för att köra din kod .

Visited 1 times, 1 visit(s) today

コメント

タイトルとURLをコピーしました