![]() |
#2
|
|||
|
|||
![]()
Not sure how you are running the code with a modal dialog open.
BUT The header and Footer is a Dialog class window "#32770" so: #If VBA7 Then Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr #Else Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long #End If Sub chex() Dim wName As String Dim hWnd Dim lpClass As String wName = "Header and Footer" lpClass = "#32770" hWnd = FindWindow(lpClass, wName) If hWnd = 0 Then MsgBox "Dialog window is not open" Else MsgBox "Dialog window is open" End If End Sub If you are opening the dialog in code you will need to incorporate a delay before checking to allow the window to open otherwise it will always show as closed. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PowerPoint 2007 --> PowerPoint 2003 Webpage? | josephsh | PowerPoint | 0 | 06-09-2011 11:22 PM |
MailItem Inspectors cache CommandBars but Calendar do not? | Hydrogen | Outlook | 0 | 03-04-2006 09:50 PM |