I have this dynamic Object to get the system.__comobject from Access:
dynamic app = Marshal.GetActiveObject("Access.Application");
And now I open a form like this:
app.Run("gbOpenDataEditPart", "ediQuali.170013662.Wawi");
and that is working. It opens the right form from Access. Now what I want is to loop if this exactly already open. I thought maybe there is a method like if(IsOpen), but it isn't open. Is there another way to loop if this is open?
And I tried it with Powershell script with that but there is the Window not there too:
$accessApp = [System.Runtime.InteropServices.Marshal]::GetActiveObject("Access.Application")
$forms = $accessApp.CurrentProject.AllForms
foreach ($form in $forms) {
Write-Host "Form name: $($form.Name)"
}
I can see my Application which I want to look if it is already open or not but when I look through AllForms with that:
CurrentProject.AllForms("HPGebote").IsLoaded
or
CurrentProject.AllForms("ediQuali.170013662.Wawi").IsLoaded
then there is no form which has the name I am searching for.
And no matter which Formular I will open in my Access:
He will always detect frmSysAuskunft and thats It no matter how many Forms I will have Open he will always just detect one with always the same name