Re : Plage d'impression d'Etiquettes
je peux savoir a quoi te sert ceci !!!!
moi perso je n'aime pas trop ce genre de chose
Option Explicit
Private Declare Function InternetOpen Lib "wininet.dll" Alias _
"InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, _
ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal _
lFlags As Long) As Long
Private Declare Function InternetCloseHandle Lib "wininet.dll" _
(ByVal hInet As Long) As Integer
Private Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" _
(ByVal hInternetSession As Long, ByVal sServerName As String, _
ByVal nServerPort As Integer, _
ByVal sUserName As String, ByVal sPassword As String, ByVal lService As Long, _
ByVal lFlags As Long, ByVal lContext As Long) As Long
Private Declare Function FtpPutFile Lib "wininet.dll" Alias _
"FtpPutFileA" (ByVal hConnect As Long, ByVal lpszLocalFile As String, _
ByVal lpszNewRemoteFile As String, ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean
Sub Transfert_FTP()
Dim HwndConnect As Long
Dim lngINet As Long
Dim I As Integer
For I = 1 To 5
lngINet = InternetOpen("Controle FTP", 1, vbNullString, vbNullString, 0)
'Connection ftp
HwndConnect = InternetConnect(lngINet, "ftpperso.free.fr", 21, _
"les.figwer", "020277", 1, 0, 0)
'transfert et renomme le fichier
FtpPutFile HwndConnect, "C:\sauve ftp.xls", "sauve ftp.xls", &H0, 0
'Fermerture
Next I
InternetCloseHandle HwndConnect
InternetCloseHandle HwndConnect
End Sub