こういう事でしょうか。Win7 + Office2010で確認
投稿用にタブインデントを全角スペースで代用しています。
Sub yy()
Dim Obj As Object
Dim i As Integer
Dim Reg As Object ' As RegExp
Dim Mc As Object ' As MatchCollection
Dim M As Object ' As Match
Set Reg = CreateObject("VBScript.RegExp")
For Each Obj In GetObject("winmgmts:\\.\root\cimv2") _
.ExecQuery( _
"Select * from Win32_Process Where Name = 'msaccess.exe'")
i = i + 1
With Reg
.pattern = """[^""]+"""
.IgnoreCase = False
.Global = True
Set Mc = .Execute(Obj.CommandLine)
End With
For Each M In Mc
If InStr(M.Value, ".mdb") <> 0 Or InStr(M.Value, ".accdb") <> 0 Then
Debug.Print i, M.Value
End If
Next
Next
End Sub
お礼
ありがとうございました。