home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 8,877 of 10,840   
   Randy Birch to Gord   
   Re: Response to overwrite prompt?   
   11 Oct 04 23:06:48   
   
   From: rgb_removethis@mvps.org   
      
   You don't. If the user selects no, they are returned to the dialog for   
   another selection or to cancel the action.  You can determine if cancel was   
   selected by setting the CancelError property to true, and adding error   
   trapping which will fire if cancel is selected. E.g. ..   
      
   Private Sub Command1_Click()   
      
      On Error Goto save_error   
      
      With CommonDialog1   
         .CancelError = True   
         .Flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNLongNames   
         .Filter = "*.bmp|*.bmp"   
         .ShowSave   
      
         If Len(.FileName) > 0 Then   
            'do something with .FileName   
         End If   
      
      End With   
      
   save_exit:   
      Exit Sub   
      
   save_error:   
      '   
      Resume save_exit   
      
   End Sub   
      
      
   --   
      
      
   Randy Birch   
   MS MVP Visual Basic   
   http://vbnet.mvps.org/   
      
      
   "Gord"  wrote in message   
   news:VBHad.13032$Ia5.9690@edtnps89...   
   : Hello,   
   :   
   : If you set the flag for an overwrite prompt using the 'Save' common   
   dialog,   
   : how do you read the response when the user clicks the Yes or No in the   
   : 'overwrite' message box?   
   :   
   : Everything I've read explains about setting the flag to bring up the   
   : overwrite prompt message box, but there's no explanation on how to read   
   the   
   : response to it.  It appears that clicking the Yes option doesn't actually   
   : overwrite the old file, so I assume I'm meant to do that in code, but of   
   : course I have to know what the damn response was!   
   :   
   : Thanks,   
   :   
   : Gord   
   :   
   :   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca