Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-24-2014, 02:48 AM
JohnWilson JohnWilson is offline CommandBars in powerpoint Windows 7 64bit CommandBars in powerpoint Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,914
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

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.
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
 



Similar Threads
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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft