## Cannot Print to Status Bar When Closing a Dialog Box

Q123300

The information in this article applies to:

- Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c

## SYMPTOMS

When you use the Print command in code in response to a button click that closes a dialog box, the text in the status bar may flash by too quickly to be seen.

## CAUSE

Closing the dialog box resets the status bar.

## STATUS

Microsoft has confirmed this to be a problem in Microsoft Word versions 6.0, 6.0a, and 6.0c for Windows. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

## MORE INFORMATION

The following sample macro demonstrates the behavior described in the "Symptoms" section above.
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

       Sub MAIN
       Begin Dialog UserDialog 109, 81, "Test", .DialogFunction
          OKButton 10, 6, 88, 21
          CancelButton 10, 30, 88, 21
          PushButton 10, 54, 88, 21, "Text"
       End Dialog

       Dim dlg As UserDialog
       x = Dialog(dlg)

       End Sub

       Function DialogFunction(identifier$, action, wvalue)
          Select Case action
             Case 1
             Case 2
                If identifier$ = "Text" Then
                   DialogFunction = 1
                   Print "Button pressed"
                Else
                   Print "This is the text that will not be seen"
                   DialogFunction = 0
                End If
             Case  3
             Case  4
             Case  5
             Case Else
          End Select
       End Function

Additional query words: 6.0 functions dynamic statement word6 winword

Keywords : kbmacroexample
Issue type :
Technology :

Last Reviewed: November 4, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use.