WD6x: InsertFile Command Returns -1 for Both OK and Cancel (139961)



The information in this article applies to:

  • Microsoft Word for the Macintosh 6.0
  • Microsoft Word for the Macintosh 6.0.1

This article was previously published under Q139961

SYMPTOMS

The InsertFile command returns -1 for both OK and Cancel. This behavior is incorrect. The command should return 0 for Cancel and -1 for Insert.

WORKAROUND

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.

Use the following macro to work around the problem.
   Sub MAIN
      On Error Goto Canc
      Dim dlg As InsertFile
      GetCurValues dlg
      Dialog dlg
      InsertFile dlg
      MsgBox "OK button pushed, file inserted."
      Goto done
   Canc:
      MsgBox "Cancel button pushed."
   done:
   End Sub
				

STATUS

Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Modification Type:MajorLast Reviewed:12/15/1999
Keywords:kbbug kbmacro KB139961