There is no way to determine whether any built-in dialog is open unless your
code was responsible for showing it.
You'll have to intercept the Save As command with your own macro (named
FileSaveAs in order to catch the command) and make it behave as you want:
Sub FileSaveAs()
Dim myUF As UserForm1
Set myUF = New UserForm1
If Dialogs(wdDialogFileSaveAs).Show = -1 Then
' user click OK in the dialog
myUF.Show
End If
Set myUF = Nothing
End Sub
To catch the Save As dialog that displays when the user first saves a new
document, you also need a FileSave macro:
Sub FileSave()
Dim myUF As UserForm1
Set myUF = New UserForm1
If Len(ActiveDocument.Path) = 0 Then
If Dialogs(wdDialogFileSaveAs).Show = -1 Then
' user click OK in the dialog
myUF.Show
End If
Else
ActiveDocument.Save
End If
Set myUF = Nothing
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ:
http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroupso
all may benefit.