mercoledì 13 maggio 2015
venerdì 8 maggio 2015
vb6 outlook
Public Sub componiMailOutlook(destinatari As String, destinatariCC As String, destinatariBcc As String, oggettoMail As String, fileAllegati As String)
Dim OutApp As Object
Dim OutMail As Object 'sarebbe un oggetto MailItem
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.display
.To = destinatari
If destinatariCC <> "" Then
.cc = destinatariCC
End If
If destinatariBcc <> "" Then
.BCC = destinatariBcc
End If
.subject = oggettoMail
'.htmlbody = testoMail
If fileAllegati <> "" Then
.Attachments.Add fileAllegati
End If
.Readreceiptrequested = False
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Dim OutApp As Object
Dim OutMail As Object 'sarebbe un oggetto MailItem
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.display
.To = destinatari
If destinatariCC <> "" Then
.cc = destinatariCC
End If
If destinatariBcc <> "" Then
.BCC = destinatariBcc
End If
.subject = oggettoMail
'.htmlbody = testoMail
If fileAllegati <> "" Then
.Attachments.Add fileAllegati
End If
.Readreceiptrequested = False
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
vb6 thinderbird
Public Sub componiMailThunderBird(destinatari As String, destinatariCC As String, destinatariBcc As String, oggettoMail As String, fileAllegati As String)
Dim comandoShell
Dim pathThunderbird As String
comandoShell = Chr(34) & pathThunderbird & Chr(34) & " -compose " & Chr(34)
comandoShell = comandoShell & "to='" & destinatari & "',"
comandoShell = comandoShell & "cc='" & destinatariCC & "',"
comandoShell = comandoShell & "bcc='" & destinatariBcc & "',"
comandoShell = comandoShell & "subject='" & oggettoMail & "'"
If fileAllegati <> "" Then
comandoShell = comandoShell & ",attachment='" & fileAllegati & "'"
End If
Shell comandoShell
End Sub
Dim comandoShell
Dim pathThunderbird As String
comandoShell = Chr(34) & pathThunderbird & Chr(34) & " -compose " & Chr(34)
comandoShell = comandoShell & "to='" & destinatari & "',"
comandoShell = comandoShell & "cc='" & destinatariCC & "',"
comandoShell = comandoShell & "bcc='" & destinatariBcc & "',"
comandoShell = comandoShell & "subject='" & oggettoMail & "'"
If fileAllegati <> "" Then
comandoShell = comandoShell & ",attachment='" & fileAllegati & "'"
End If
Shell comandoShell
End Sub
giovedì 7 maggio 2015
vb6 winrar
Private Sub cmdComprimi_Click()
Dim comando As String
Dim nomedir As String
Dim strAnno As String
Dim strMese As String
Dim S As Object
'imposta il nome del file.Presuponendo che il periodo scelto sia un mese e quindi prende in considerazione il mede della data di inizio estrazione
'se inevecej è un trimestre mette il primo carattere del cmbmese
strAnno = Year(Me.TxtInizio)
strMese = Format(Month(Me.TxtInizio), "00")
If Me.CmbTipoPeriodo = "trim" Then
strMese = "trim" & Left(Me.CmbMese, 1)
End If
nomedir = App.Path & "\report" & strAnno & "\" & strAnno & "_" & strMese & "\"
comando = "c:\Programmi\WinRAR\rar.exe a " & """" & nomedir & strAnno & "_" & strMese & ".rar"" -p" & Format(Me.TxtInizio, "mmmmYYYY") & " -ep " & Chr(34) & nomedir & "*" & Chr(34)
Shell comando
Set S = CreateObject("Shell.Application")
S.ShellExecute (nomedir)
Open nomedir & "pw.txt" For Output As #1
Print #1, Format(Me.TxtInizio, "mmmmYYYY")
Close (1)
End Sub
Dim comando As String
Dim nomedir As String
Dim strAnno As String
Dim strMese As String
Dim S As Object
'imposta il nome del file.Presuponendo che il periodo scelto sia un mese e quindi prende in considerazione il mede della data di inizio estrazione
'se inevecej è un trimestre mette il primo carattere del cmbmese
strAnno = Year(Me.TxtInizio)
strMese = Format(Month(Me.TxtInizio), "00")
If Me.CmbTipoPeriodo = "trim" Then
strMese = "trim" & Left(Me.CmbMese, 1)
End If
nomedir = App.Path & "\report" & strAnno & "\" & strAnno & "_" & strMese & "\"
comando = "c:\Programmi\WinRAR\rar.exe a " & """" & nomedir & strAnno & "_" & strMese & ".rar"" -p" & Format(Me.TxtInizio, "mmmmYYYY") & " -ep " & Chr(34) & nomedir & "*" & Chr(34)
Shell comando
Set S = CreateObject("Shell.Application")
S.ShellExecute (nomedir)
Open nomedir & "pw.txt" For Output As #1
Print #1, Format(Me.TxtInizio, "mmmmYYYY")
Close (1)
End Sub
Iscriviti a:
Post (Atom)