🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #2380

R: avvertire un utente che sta salvando un file gia esistente

#2380
From: Alessio
Date: Wed, 11 Jun 2003 22:23
70 lines
3570 bytes
Genesio Conti <genesio.conti@virgilio.it> wrote in message
gTzFa.118422$g92.2759849@news2.tin.it...
>
> "Alessio" <@ .it> ha scritto nel messaggio
> news:ABoFa.70335$pR3.1485144@news1.tin.it...
> >
> > Genesio Conti <genesio.conti@virgilio.it> wrote in message
> > TY2Fa.64566$pR3.1385021@news1.tin.it...
> > >
> > > "Alessio" <@ .it> ha scritto nel messaggio
> > > news:hbOEa.99319$g92.2366727@news2.tin.it...
> > > > o creato un programma compatibile con diversi formato di testo nella
> > quale
> > > > devo inserire una modalita di avvertimento che l'utente finale sta
per
> > > > salvare su un file esistente e inserire un messaggio personalizato (
> non
> > > di
> > > > Windows ) Ad esempio
> > > > il file Pinco.doc esiste gia sei sicuro di riscriverlo?.
> > > > o il seguente codice ( dove devo inserire questo tipo di modalita
> > > > grazie in anticipo per l'aiuto
> > > >
> > > > PS: chiedo scusa se non avete capito questo messaggio
> > >
> > > Se utilizzi CommonDialog, prima del metodo CommonDialog1.ShowSave,
> imposta
> > > il flag
> > > cdlOFNOverwritePrompt, e ti verr� mostrato il msg " Il file esiste,
> ecc."
> > >
> > > altrimenti prima di salvare il file :
> > > if Dir$(nome_file_con_path) <> "" then ' il file esiste che facciamo ?
> > > ...
> > > end if
> > >
> > >
> > o provato ma non funziona
>
> Non � che per caso prima lo apri con open, ecc ecc., xch� in quel caso un
> file aperto equivale ad un file esistente con len =0 ?
> Se puoi postare un spezzone di codice � meglio...
>
> Genesio
>
>
uso questo codice si ti puo esere di aiuto per risorvermi il problema
Private Sub mnuSaveAs_Click()
  On Error GoTo SaveCancelled

MDIForm1.CommonDialog1.Filter = "File edit document text(*.edt)|*edt| File
RTF (*.rtf)|*.rtf|File word (*.doc)|*.doc|Tutti i file (*.*)|*.*"
  CommonDialog1.ShowSave

  If CommonDialog1.FileName = "" Then Exit Sub
  Open CommonDialog1.FileName For Output As #1
  Print #1, ChildForms(frm).text1.TextRTF
  Close #1
  If NeedSaved(frm) = True Then
    NeedSaved(frm) = False
    ChildForms(frm).Caption = Right$(ChildForms(frm).Caption,
Len(ChildForms(frm).Caption) - 1)
  End If
  ChildForms(frm).Caption = CommonDialog1.FileTitle
  file(frm) = CommonDialog1.FileTitle
  PFile(frm) = CommonDialog1.FileName

SaveCancelled:
End Sub
Technical Details
Message-ID: <CZNFa.77365$pR3.1620202@news1.tin.it>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.mailgate.org!nntp.infostrada.it!news-out.tin.it!news-in.tin.it!news1.tin.it.POSTED!not-for-mail
References: <hbOEa.99319$g92.2366727@news2.tin.it> <TY2Fa.64566$pR3.1385021@news1.tin.it> <ABoFa.70335$pR3.1485144@news1.tin.it> <gTzFa.118422$g92.2759849@news2.tin.it>

Show Full Headers
Complete Article Headers
X-Google-Language: ITALIAN,ASCII
X-Google-Thread: f94ee,ff90c2e0f5ee5253
X-Google-Attributes: gidf94ee,public
X-Google-ArrivalTime: 2003-06-11 15:23:35 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.mailgate.org!nntp.infostrada.it!news-out.tin.it!news-in.tin.it!news1.tin.it.POSTED!not-for-mail
From: "Alessio" <@ .it>
Newsgroups: free.it.visual-basic
References: <hbOEa.99319$g92.2366727@news2.tin.it> <TY2Fa.64566$pR3.1385021@news1.tin.it> <ABoFa.70335$pR3.1485144@news1.tin.it> <gTzFa.118422$g92.2759849@news2.tin.it>
Subject: R: avvertire un utente che sta salvando un file gia esistente
Lines: 73
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Message-ID: <CZNFa.77365$pR3.1620202@news1.tin.it>
Date: Wed, 11 Jun 2003 22:23:30 GMT
NNTP-Posting-Host: 80.104.169.201
X-Complaints-To: newsmaster@tin.it
X-Trace: news1.tin.it 1055370210 80.104.169.201 (Thu, 12 Jun 2003 00:23:30 MET DST)
NNTP-Posting-Date: Thu, 12 Jun 2003 00:23:30 MET DST
Organization: TIN