Private Sub cmdSalva_Click()
If Len(Trim(txtNome.Text)) = 0 Then
MsgBox "Inserire il nome del file", vbCritical, "Errore"
txtNome.SetFocus
Exit Sub
End If
If Len(Trim(cmbTipo.Text)) = 0 Then
MsgBox "Inserire l'estensione del file", vbCritical, "Errore"
cmbTipo.SetFocus
Exit Sub
End If
Dim nome_file As String
nome_file = txtNome.Text & cmbTipo.Text
On Error Resume Next
Kill "C:\" & nome_file
Open "C:\" & nome_file For Append As #1
Print #1, txtCodice
Close #1
MsgBox "File " & nome_file & " creato con successo", vbOKOnly, "Conferma"
End Sub
Private Sub Form_Load()
txtCodice = ""
txtCodice = txtCodice & "<html>" & vbCrLf
txtCodice = txtCodice & "<head>" & vbCrLf
txtCodice = txtCodice & "<title>HTML Editor</title>" & vbCrLf
txtCodice = txtCodice & "<head>" & vbCrLf
txtCodice = txtCodice & "<body>" & vbCrLf & vbCrLf & vbCrLf & vbCrLf
txtCodice = txtCodice & "</body>" & vbCrLf
txtCodice = txtCodice & "</html>" & vbCrLf
cmbTipo.AddItem (".htm")
cmbTipo.AddItem (".html")
cmbTipo.AddItem (".css")
cmbTipo.AddItem (".js")
cmbTipo.AddItem (".xml")
cmbTipo.AddItem (".xsl")
cmbTipo.AddItem (".asp")
cmbTipo.AddItem (".aspx")
cmbTipo.AddItem (".php")
cmbTipo.AddItem (".inc")
cmbTipo.AddItem (".txt")
End Sub