zido85
Messages postés14Date d'inscriptionmardi 15 mars 2005StatutMembreDernière intervention18 février 2006
-
26 janv. 2006 à 23:21
zido85
Messages postés14Date d'inscriptionmardi 15 mars 2005StatutMembreDernière intervention18 février 2006
-
3 févr. 2006 à 13:54
salut, coment ca va, je suis ziad du liban , et je demande l'aide pour savoir comment sauvgarder avec la command utiliser du common dialog .merci
un exemple peut aider plus:D
jpleroisse
Messages postés1788Date d'inscriptionmardi 7 novembre 2000StatutMembreDernière intervention11 mars 200627 27 janv. 2006 à 00:53
Bonsoir,
Tu places sur ta Form 1 TextBox (propriété Multiligne à True), 1 CommandButton et un CommonDialog.
Code:
Private Sub Command1_Click()
Dim NomFich
With CommonDialog1
.DialogTitle = "Sauvegarder un fichier"
.CancelError = True
.InitDir = "C:"
.Filter = "Texte(*.txt)|*.txt|Tous(*.*)|*.*"
.FilterIndex = 1
.FileName = "MonFichier.txt"
On Error GoTo Erreur
.ShowSave
End With
NomFich = CommonDialog1.FileName
Open NomFich For Output As #1
Print #1, Text1.Text
Close #1
GoTo Suite
Erreur: MsgBox "Vous n'avez sauvegardé aucun fichier"
Suite:
End Sub
jpleroisse
Si une réponse vous convient, cliquez Réponse Acceptée.