je souhaiterais maintenant que le programme envoie également ce fichier en
pièce jointe par email (au travers de outlook express ou autre)
je souhaiterais maintenant que le programme envoie également ce fichier en
pièce jointe par email (au travers de outlook express ou autre)
je souhaiterais maintenant que le programme envoie également ce fichier en
pièce jointe par email (au travers de outlook express ou autre)
Eric
> je souhaiterais maintenant que le programme envoie également ce fichier
> pièce jointe par email (au travers de outlook express ou autre)
J'utilise le contrôle MAPI et un bout de code comme celui-ci
' isnetconnectonline permet de connaître l'état de connection au réseau,
net....
Public Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef
lpdwFlags As Long, ByVal dwReserved As Long) As Long
Public Function IsNetConnectOnline() As Boolean
Dim ret As Long
InternetGetConnectedState ret, 0&
If (ret And INTERNET_CONNECTION_CONFIGURED) INTERNET_CONNECTION_CONFIGURED
Then rep = 1
If (ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then rep 2
If (ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then
= 3
If (ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE
rep = 4
If (ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then
= 5
If (ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then rep = 6
Select Case rep
Case 1
msg = "Local system has a valid connection to the Internet, but it may or
may not be currently connected."
Case 2
msg = "Local system uses a local area network to connect to the
Case 3
msg = "Local system uses a modem to connect to the Internet."
Case 4
msg = "Local system is in offline mode."
Case 5
msg = "Local system uses a proxy server to connect to the Internet."
Case 6
msg = "Local system has RAS installed."
End Select
IsNetConnectOnline = rep
End Function
If IsNetConnectOnline = 4 Then
MsgBox "Enregistrez le fichier et envoyez-le moi à l'adresse
", vbInformation
Dim sFile As String
With frmMain.dlgCommonDialog
.InitDir = app.Path
.FileName = "text.txt"
.ShowSave
If Len(.FileName) = 0 Then Exit Sub
nomfic = .FileName
End With
Call sauvetxt(nomfic)
Else
rep = MsgBox("La demande va être directement envoyée à mon adresse
Email" _
+ Chr(10) + "Répondez ""ENVOYER"" à la demande d'envoi de l'email" _
+ Chr(10) + Chr(10) + "Voulez vous continuer???", _
vbYesNo + vbInformation)
If rep <> 6 Then Exit Sub
fiopte = app.Path & "text.txt"
Call sauvetxt(fiopte)
DoEvents
On Error GoTo PBenvoi
MAPISession1.SignOn
With MAPIMessages1
.SessionID = MAPISession1.SessionID
.Compose
.RecipAddress = ""
.MsgSubject = "Envoi des informations pour déblocage" 'Objet du
message
.MsgNoteText = "Demande à traiter" 'Contenu du message
.AttachmentPathName = fiopte 'fichier joint
.Send
End With
MAPISession1.SignOff
If FileExists(fiopte) Then Kill fiopte
Exit Sub
PBenvoi:
MsgBox "Votre messagerie ne peut pas envoyer les informations." +
Chr(10) + Chr(10) + _
"Il faut enregistrer le fichier puis me l'envoyer : "
With frmMain.dlgCommonDialog
.InitDir = app.Path
.FileName = "text.txt"
.ShowSave
If Len(.FileName) = 0 Then Exit Sub
nomfic = .FileName
End With
Call sauvetxt(nomfic)
TouTi
Eric
> je souhaiterais maintenant que le programme envoie également ce fichier
> pièce jointe par email (au travers de outlook express ou autre)
J'utilise le contrôle MAPI et un bout de code comme celui-ci
' isnetconnectonline permet de connaître l'état de connection au réseau,
net....
Public Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef
lpdwFlags As Long, ByVal dwReserved As Long) As Long
Public Function IsNetConnectOnline() As Boolean
Dim ret As Long
InternetGetConnectedState ret, 0&
If (ret And INTERNET_CONNECTION_CONFIGURED) INTERNET_CONNECTION_CONFIGURED
Then rep = 1
If (ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then rep 2
If (ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then
= 3
If (ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE
rep = 4
If (ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then
= 5
If (ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then rep = 6
Select Case rep
Case 1
msg = "Local system has a valid connection to the Internet, but it may or
may not be currently connected."
Case 2
msg = "Local system uses a local area network to connect to the
Case 3
msg = "Local system uses a modem to connect to the Internet."
Case 4
msg = "Local system is in offline mode."
Case 5
msg = "Local system uses a proxy server to connect to the Internet."
Case 6
msg = "Local system has RAS installed."
End Select
IsNetConnectOnline = rep
End Function
If IsNetConnectOnline = 4 Then
MsgBox "Enregistrez le fichier et envoyez-le moi à l'adresse
adresse@domaine", vbInformation
Dim sFile As String
With frmMain.dlgCommonDialog
.InitDir = app.Path
.FileName = "text.txt"
.ShowSave
If Len(.FileName) = 0 Then Exit Sub
nomfic = .FileName
End With
Call sauvetxt(nomfic)
Else
rep = MsgBox("La demande va être directement envoyée à mon adresse
Email" _
+ Chr(10) + "Répondez ""ENVOYER"" à la demande d'envoi de l'email" _
+ Chr(10) + Chr(10) + "Voulez vous continuer???", _
vbYesNo + vbInformation)
If rep <> 6 Then Exit Sub
fiopte = app.Path & "text.txt"
Call sauvetxt(fiopte)
DoEvents
On Error GoTo PBenvoi
MAPISession1.SignOn
With MAPIMessages1
.SessionID = MAPISession1.SessionID
.Compose
.RecipAddress = "adresse@domaine"
.MsgSubject = "Envoi des informations pour déblocage" 'Objet du
message
.MsgNoteText = "Demande à traiter" 'Contenu du message
.AttachmentPathName = fiopte 'fichier joint
.Send
End With
MAPISession1.SignOff
If FileExists(fiopte) Then Kill fiopte
Exit Sub
PBenvoi:
MsgBox "Votre messagerie ne peut pas envoyer les informations." +
Chr(10) + Chr(10) + _
"Il faut enregistrer le fichier puis me l'envoyer : adresse@domaine"
With frmMain.dlgCommonDialog
.InitDir = app.Path
.FileName = "text.txt"
.ShowSave
If Len(.FileName) = 0 Then Exit Sub
nomfic = .FileName
End With
Call sauvetxt(nomfic)
TouTi
Eric
> je souhaiterais maintenant que le programme envoie également ce fichier
> pièce jointe par email (au travers de outlook express ou autre)
J'utilise le contrôle MAPI et un bout de code comme celui-ci
' isnetconnectonline permet de connaître l'état de connection au réseau,
net....
Public Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef
lpdwFlags As Long, ByVal dwReserved As Long) As Long
Public Function IsNetConnectOnline() As Boolean
Dim ret As Long
InternetGetConnectedState ret, 0&
If (ret And INTERNET_CONNECTION_CONFIGURED) INTERNET_CONNECTION_CONFIGURED
Then rep = 1
If (ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then rep 2
If (ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then
= 3
If (ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE
rep = 4
If (ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then
= 5
If (ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then rep = 6
Select Case rep
Case 1
msg = "Local system has a valid connection to the Internet, but it may or
may not be currently connected."
Case 2
msg = "Local system uses a local area network to connect to the
Case 3
msg = "Local system uses a modem to connect to the Internet."
Case 4
msg = "Local system is in offline mode."
Case 5
msg = "Local system uses a proxy server to connect to the Internet."
Case 6
msg = "Local system has RAS installed."
End Select
IsNetConnectOnline = rep
End Function
If IsNetConnectOnline = 4 Then
MsgBox "Enregistrez le fichier et envoyez-le moi à l'adresse
", vbInformation
Dim sFile As String
With frmMain.dlgCommonDialog
.InitDir = app.Path
.FileName = "text.txt"
.ShowSave
If Len(.FileName) = 0 Then Exit Sub
nomfic = .FileName
End With
Call sauvetxt(nomfic)
Else
rep = MsgBox("La demande va être directement envoyée à mon adresse
Email" _
+ Chr(10) + "Répondez ""ENVOYER"" à la demande d'envoi de l'email" _
+ Chr(10) + Chr(10) + "Voulez vous continuer???", _
vbYesNo + vbInformation)
If rep <> 6 Then Exit Sub
fiopte = app.Path & "text.txt"
Call sauvetxt(fiopte)
DoEvents
On Error GoTo PBenvoi
MAPISession1.SignOn
With MAPIMessages1
.SessionID = MAPISession1.SessionID
.Compose
.RecipAddress = ""
.MsgSubject = "Envoi des informations pour déblocage" 'Objet du
message
.MsgNoteText = "Demande à traiter" 'Contenu du message
.AttachmentPathName = fiopte 'fichier joint
.Send
End With
MAPISession1.SignOff
If FileExists(fiopte) Then Kill fiopte
Exit Sub
PBenvoi:
MsgBox "Votre messagerie ne peut pas envoyer les informations." +
Chr(10) + Chr(10) + _
"Il faut enregistrer le fichier puis me l'envoyer : "
With frmMain.dlgCommonDialog
.InitDir = app.Path
.FileName = "text.txt"
.ShowSave
If Len(.FileName) = 0 Then Exit Sub
nomfic = .FileName
End With
Call sauvetxt(nomfic)
TouTi
bonjour touti
j'ai tenté de mettre ce code, sans succès ;(
le passage dans la fonction IsNetConnectOnline ne me retourne aucune
rep ?
meilleures salutations
Eric
"TouTi" <gelapplication[Nospam]@tiscali.fr> a écrit dans le message de
news:43a131be$0$19690$
> Eric
>
> > je souhaiterais maintenant que le programme envoie également ce
en
> > pièce jointe par email (au travers de outlook express ou autre)
>
> J'utilise le contrôle MAPI et un bout de code comme celui-ci
>
> ' isnetconnectonline permet de connaître l'état de connection au réseau,
au
> net....
> Public Declare Function InternetGetConnectedState Lib "wininet.dll"
> lpdwFlags As Long, ByVal dwReserved As Long) As Long
>
> Public Function IsNetConnectOnline() As Boolean
> Dim ret As Long
> InternetGetConnectedState ret, 0&
> If (ret And INTERNET_CONNECTION_CONFIGURED) > INTERNET_CONNECTION_CONFIGURED
> Then rep = 1
> If (ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then rep
> If (ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then
rep
> = 3
> If (ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE
Then
> rep = 4
> If (ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then
rep
> = 5
> If (ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then rep 6
> Select Case rep
> Case 1
> msg = "Local system has a valid connection to the Internet, but it may
> may not be currently connected."
> Case 2
> msg = "Local system uses a local area network to connect to the
Internet."
> Case 3
> msg = "Local system uses a modem to connect to the Internet."
> Case 4
> msg = "Local system is in offline mode."
> Case 5
> msg = "Local system uses a proxy server to connect to the Internet."
> Case 6
> msg = "Local system has RAS installed."
> End Select
> IsNetConnectOnline = rep
> End Function
>
>
> If IsNetConnectOnline = 4 Then
> MsgBox "Enregistrez le fichier et envoyez-le moi à l'adresse
> ", vbInformation
> Dim sFile As String
> With frmMain.dlgCommonDialog
> .InitDir = app.Path
> .FileName = "text.txt"
> .ShowSave
> If Len(.FileName) = 0 Then Exit Sub
> nomfic = .FileName
> End With
> Call sauvetxt(nomfic)
> Else
> rep = MsgBox("La demande va être directement envoyée à mon adresse
> Email" _
> + Chr(10) + "Répondez ""ENVOYER"" à la demande d'envoi de l'email" _
> + Chr(10) + Chr(10) + "Voulez vous continuer???", _
> vbYesNo + vbInformation)
> If rep <> 6 Then Exit Sub
> fiopte = app.Path & "text.txt"
> Call sauvetxt(fiopte)
> DoEvents
> On Error GoTo PBenvoi
> MAPISession1.SignOn
> With MAPIMessages1
> .SessionID = MAPISession1.SessionID
> .Compose
> .RecipAddress = ""
> .MsgSubject = "Envoi des informations pour déblocage" 'Objet du
> message
> .MsgNoteText = "Demande à traiter" 'Contenu du message
> .AttachmentPathName = fiopte 'fichier joint
> .Send
> End With
> MAPISession1.SignOff
> If FileExists(fiopte) Then Kill fiopte
> Exit Sub
>
> PBenvoi:
> MsgBox "Votre messagerie ne peut pas envoyer les informations." +
> Chr(10) + Chr(10) + _
> "Il faut enregistrer le fichier puis me l'envoyer : "
> With frmMain.dlgCommonDialog
> .InitDir = app.Path
> .FileName = "text.txt"
> .ShowSave
> If Len(.FileName) = 0 Then Exit Sub
> nomfic = .FileName
> End With
> Call sauvetxt(nomfic)
>
>
> TouTi
>
>
bonjour touti
j'ai tenté de mettre ce code, sans succès ;(
le passage dans la fonction IsNetConnectOnline ne me retourne aucune
rep ?
meilleures salutations
Eric
"TouTi" <gelapplication[Nospam]@tiscali.fr> a écrit dans le message de
news:43a131be$0$19690$8fcfb975@news.wanadoo.fr...
> Eric
>
> > je souhaiterais maintenant que le programme envoie également ce
en
> > pièce jointe par email (au travers de outlook express ou autre)
>
> J'utilise le contrôle MAPI et un bout de code comme celui-ci
>
> ' isnetconnectonline permet de connaître l'état de connection au réseau,
au
> net....
> Public Declare Function InternetGetConnectedState Lib "wininet.dll"
> lpdwFlags As Long, ByVal dwReserved As Long) As Long
>
> Public Function IsNetConnectOnline() As Boolean
> Dim ret As Long
> InternetGetConnectedState ret, 0&
> If (ret And INTERNET_CONNECTION_CONFIGURED) > INTERNET_CONNECTION_CONFIGURED
> Then rep = 1
> If (ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then rep
> If (ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then
rep
> = 3
> If (ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE
Then
> rep = 4
> If (ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then
rep
> = 5
> If (ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then rep 6
> Select Case rep
> Case 1
> msg = "Local system has a valid connection to the Internet, but it may
> may not be currently connected."
> Case 2
> msg = "Local system uses a local area network to connect to the
Internet."
> Case 3
> msg = "Local system uses a modem to connect to the Internet."
> Case 4
> msg = "Local system is in offline mode."
> Case 5
> msg = "Local system uses a proxy server to connect to the Internet."
> Case 6
> msg = "Local system has RAS installed."
> End Select
> IsNetConnectOnline = rep
> End Function
>
>
> If IsNetConnectOnline = 4 Then
> MsgBox "Enregistrez le fichier et envoyez-le moi à l'adresse
> adresse@domaine", vbInformation
> Dim sFile As String
> With frmMain.dlgCommonDialog
> .InitDir = app.Path
> .FileName = "text.txt"
> .ShowSave
> If Len(.FileName) = 0 Then Exit Sub
> nomfic = .FileName
> End With
> Call sauvetxt(nomfic)
> Else
> rep = MsgBox("La demande va être directement envoyée à mon adresse
> Email" _
> + Chr(10) + "Répondez ""ENVOYER"" à la demande d'envoi de l'email" _
> + Chr(10) + Chr(10) + "Voulez vous continuer???", _
> vbYesNo + vbInformation)
> If rep <> 6 Then Exit Sub
> fiopte = app.Path & "text.txt"
> Call sauvetxt(fiopte)
> DoEvents
> On Error GoTo PBenvoi
> MAPISession1.SignOn
> With MAPIMessages1
> .SessionID = MAPISession1.SessionID
> .Compose
> .RecipAddress = "adresse@domaine"
> .MsgSubject = "Envoi des informations pour déblocage" 'Objet du
> message
> .MsgNoteText = "Demande à traiter" 'Contenu du message
> .AttachmentPathName = fiopte 'fichier joint
> .Send
> End With
> MAPISession1.SignOff
> If FileExists(fiopte) Then Kill fiopte
> Exit Sub
>
> PBenvoi:
> MsgBox "Votre messagerie ne peut pas envoyer les informations." +
> Chr(10) + Chr(10) + _
> "Il faut enregistrer le fichier puis me l'envoyer : adresse@domaine"
> With frmMain.dlgCommonDialog
> .InitDir = app.Path
> .FileName = "text.txt"
> .ShowSave
> If Len(.FileName) = 0 Then Exit Sub
> nomfic = .FileName
> End With
> Call sauvetxt(nomfic)
>
>
> TouTi
>
>
bonjour touti
j'ai tenté de mettre ce code, sans succès ;(
le passage dans la fonction IsNetConnectOnline ne me retourne aucune
rep ?
meilleures salutations
Eric
"TouTi" <gelapplication[Nospam]@tiscali.fr> a écrit dans le message de
news:43a131be$0$19690$
> Eric
>
> > je souhaiterais maintenant que le programme envoie également ce
en
> > pièce jointe par email (au travers de outlook express ou autre)
>
> J'utilise le contrôle MAPI et un bout de code comme celui-ci
>
> ' isnetconnectonline permet de connaître l'état de connection au réseau,
au
> net....
> Public Declare Function InternetGetConnectedState Lib "wininet.dll"
> lpdwFlags As Long, ByVal dwReserved As Long) As Long
>
> Public Function IsNetConnectOnline() As Boolean
> Dim ret As Long
> InternetGetConnectedState ret, 0&
> If (ret And INTERNET_CONNECTION_CONFIGURED) > INTERNET_CONNECTION_CONFIGURED
> Then rep = 1
> If (ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then rep
> If (ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then
rep
> = 3
> If (ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE
Then
> rep = 4
> If (ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then
rep
> = 5
> If (ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then rep 6
> Select Case rep
> Case 1
> msg = "Local system has a valid connection to the Internet, but it may
> may not be currently connected."
> Case 2
> msg = "Local system uses a local area network to connect to the
Internet."
> Case 3
> msg = "Local system uses a modem to connect to the Internet."
> Case 4
> msg = "Local system is in offline mode."
> Case 5
> msg = "Local system uses a proxy server to connect to the Internet."
> Case 6
> msg = "Local system has RAS installed."
> End Select
> IsNetConnectOnline = rep
> End Function
>
>
> If IsNetConnectOnline = 4 Then
> MsgBox "Enregistrez le fichier et envoyez-le moi à l'adresse
> ", vbInformation
> Dim sFile As String
> With frmMain.dlgCommonDialog
> .InitDir = app.Path
> .FileName = "text.txt"
> .ShowSave
> If Len(.FileName) = 0 Then Exit Sub
> nomfic = .FileName
> End With
> Call sauvetxt(nomfic)
> Else
> rep = MsgBox("La demande va être directement envoyée à mon adresse
> Email" _
> + Chr(10) + "Répondez ""ENVOYER"" à la demande d'envoi de l'email" _
> + Chr(10) + Chr(10) + "Voulez vous continuer???", _
> vbYesNo + vbInformation)
> If rep <> 6 Then Exit Sub
> fiopte = app.Path & "text.txt"
> Call sauvetxt(fiopte)
> DoEvents
> On Error GoTo PBenvoi
> MAPISession1.SignOn
> With MAPIMessages1
> .SessionID = MAPISession1.SessionID
> .Compose
> .RecipAddress = ""
> .MsgSubject = "Envoi des informations pour déblocage" 'Objet du
> message
> .MsgNoteText = "Demande à traiter" 'Contenu du message
> .AttachmentPathName = fiopte 'fichier joint
> .Send
> End With
> MAPISession1.SignOff
> If FileExists(fiopte) Then Kill fiopte
> Exit Sub
>
> PBenvoi:
> MsgBox "Votre messagerie ne peut pas envoyer les informations." +
> Chr(10) + Chr(10) + _
> "Il faut enregistrer le fichier puis me l'envoyer : "
> With frmMain.dlgCommonDialog
> .InitDir = app.Path
> .FileName = "text.txt"
> .ShowSave
> If Len(.FileName) = 0 Then Exit Sub
> nomfic = .FileName
> End With
> Call sauvetxt(nomfic)
>
>
> TouTi
>
>
j'ai tenté de mettre ce code, sans succès ;(
le passage dans la fonction IsNetConnectOnline ne me retourne aucune
rep ?
j'ai tenté de mettre ce code, sans succès ;(
le passage dans la fonction IsNetConnectOnline ne me retourne aucune
rep ?
j'ai tenté de mettre ce code, sans succès ;(
le passage dans la fonction IsNetConnectOnline ne me retourne aucune
rep ?