Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Créer un rappel outlook via un fichier excel

10 réponses
Avatar
Valoche54
Bonjour,
J'ai besoin d'aide...
J'ai créé une liste de commande sous excel et j'aimerai faire un lien automatique vers outlook pour avoir des rappels mes dates de livraison prévues -1.
Beaucoup d’exemples sur la toile et je suis bien novice donc j’espère simplifier mon travail avec vous, car je n'ai pas trouvé de tuto la-dessus, bien sûr si c’est possible.
Merci d’avance.

http://www.cjoint.com/c/FKwqoojyr0f

10 réponses

Avatar
DanielCo
Bonjour,
Adapte le code suivant (j'ai mis une alerte 4 jours avant la date) :
Sub CreerRappel()
Dim OlApp As Object, myItem As Object
Set OlApp = CreateObject("Outlook.Application")
Set myItem = OlApp.CreateItem(3)
myItem.Subject = "Rappel commande"
myItem.Body = Range("C4").Value
myItem.ReminderTime = Range("H4").Value - 4
myItem.DueDate = Range("H4").Value
myItem.ReminderSet = True
myItem.Display
End Sub
Cordialement.
Daniel
Bonjour,
J'ai besoin d'aide...
J'ai créé une liste de commande sous excel et j'aimerai faire un lien
automatique vers outlook pour avoir des rappels mes dates de
livraison prévues -1.
Beaucoup d’exemples sur la toile et je suis bien novice donc j’espère
simplifier mon travail avec vous, car je n'ai pas trouvé de tuto
la-dessus, bien sûr si c’est possible.
Merci d’avance.
http://www.cjoint.com/c/FKwqoojyr0f
Avatar
DanielCo
PS. Quand c'est au point, remplace :
myitem.Display
par
myitem.save
Daniel
Bonjour,
J'ai besoin d'aide...
J'ai créé une liste de commande sous excel et j'aimerai faire un lien
automatique vers outlook pour avoir des rappels mes dates de
livraison prévues -1.
Beaucoup d’exemples sur la toile et je suis bien novice donc j’espère
simplifier mon travail avec vous, car je n'ai pas trouvé de tuto
la-dessus, bien sûr si c’est possible.
Merci d’avance.
http://www.cjoint.com/c/FKwqoojyr0f
Avatar
JièL
Daniel, une question sans grand rapport...
en VBS (pas VBA, mais je crois savoir que c'est pareil), comment peut-on
savoir quels objets on peut manipuler CreateObject("???") et comment
peut-on savoir ce qu'on peut faire avec ces objets comme
OlApp.CreateItem(3) ?
--
JièL homme objet non manipulable ;-)
Le 23/11/2016 à 11:11, DanielCo a écrit :
Bonjour,
Adapte le code suivant (j'ai mis une alerte 4 jours avant la date) :
Sub CreerRappel()
Dim OlApp As Object, myItem As Object
Set OlApp = CreateObject("Outlook.Application")
Set myItem = OlApp.CreateItem(3)
myItem.Subject = "Rappel commande"
myItem.Body = Range("C4").Value
myItem.ReminderTime = Range("H4").Value - 4
myItem.DueDate = Range("H4").Value
myItem.ReminderSet = True
myItem.Display
End Sub
Cordialement.
Daniel
Bonjour, J'ai besoin d'aide... J'ai créé une liste de commande sous
excel et j'aimerai faire un lien
automatique vers outlook pour avoir des rappels mes dates de livraison
prévues -1. Beaucoup d’exemples sur la toile et je suis bien novice
donc j’espère simplifier mon travail avec vous, car je n'ai pas trouvé
de tuto la-dessus, bien sûr si c’est possible. Merci d’avance.
http://www.cjoint.com/c/FKwqoojyr0f
Avatar
DanielCo
Bonjour JièL,
Désolé, je ne connais pas VBS. Je sens que je ne vais pas être d'une
grande aide pour CreateObject... Apparemment, tu mets des applications,
mais pas seulement, par exemple "fso =
CreateObject("Scripting.FileSystemObject")"). Je te mets l'aide VBA (en
anglais, faute de mieux)
***
Creates and returns a reference to an ActiveX object.
Syntax
CreateObject( class,[servername] )
The CreateObject function syntax has these parts:
Part
Description
class
Required; Variant (String). The application name and class of the
object to create.
servername
Optional; Variant (String). The name of the network server where the
object will be created. If servername is an empty string (""), the
local machine is used.
The class argument uses the syntax appname.objecttype and has these
parts:
Part
Description
appname
Required; Variant (String). The name of the application providing the
object.
objecttype
Required; Variant (String). The type or class of object to create.
Remarks
Every application that supports Automation provides at least one type
of object. For example, a word processing application may provide an
Application object, a Document object, and a Toolbar object.
To create an ActiveX object, assign the object returned by CreateObject
to an object variable:
VBA Copy codeCopy code
' Declare an object variable to hold the object
' reference. Dim as Object causes late binding.
Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")
This code starts the application creating the object, in this case, a
Microsoft Excel spreadsheet. Once an object is created, you reference
it in code using the object variable you defined. In the following
example, you access properties and methods of the new object using the
object variable, ExcelSheet, and other Microsoft Excel objects,
including the Application object and the Cells collection.
VBA Copy codeCopy code
' Make Excel visible through the Application object.
ExcelSheet.Application.Visible = True
' Place some text in the first cell of the sheet.
ExcelSheet.Application.Cells(1, 1).Value = "This is column A, row 1"
' Save the sheet to C:test.xls directory.
ExcelSheet.SaveAs "C:TEST.XLS"
' Close Excel with the Quit method on the Application object.
ExcelSheet.Application.Quit
' Release the object variable.
Set ExcelSheet = Nothing
Declaring an object variable with the As Object clause creates a
variable that can contain a reference to any type of object. However,
access to the object through that variable is late bound; that is, the
binding occurs when your program is run. To create an object variable
that results in early binding, that is, binding when the program is
compiled, declare the object variable with a specific class ID. For
example, you can declare and create the following Microsoft Excel
references:
VBA Copy codeCopy code
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.WorkSheet
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)
The reference through an early-bound variable can give better
performance, but can only contain a reference to the class specified in
the declaration.
You can pass an object returned by the CreateObject function to a
function expecting an object as an argument. For example, the following
code creates and passes a reference to a Excel.Application object:
VBA Copy codeCopy code
Call MySub (CreateObject("Excel.Application"))
You can create an object on a remote networked computer by passing the
name of the computer to the servername argument of CreateObject. That
name is the same as the Machine Name portion of a share name: for a
share named "MyServerPublic," servername is "MyServer."
Note Note
Refer to COM documentation (see Microsoft Developer Network) for
additional information on making an application visible on a remote
networked computer. You may have to add a registry key for your
application.
The following code returns the version number of an instance of Excel
running on a remote computer named MyServer:
VBA Copy codeCopy code
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application", "MyServer")
Debug.Print xlApp.Version
If the remote server doesn't exist or is unavailable, a run-time error
occurs.
Note Note
Use CreateObject when there is no current instance of the object. If an
instance of the object is already running, a new instance is started,
and an object of the specified type is created. To use the current
instance, or to start the application and have it load a file, use the
GetObject function.
If an object has registered itself as a single-instance object, only
one instance of the object is created, no matter how many times
CreateObject is executed.
Collapse sectionExample
This example uses the CreateObject function to set a reference (xlApp)
to Microsoft Excel. It uses the reference to access the Visible
property of Microsoft Excel, and then uses the Microsoft Excel Quit
method to close it. Finally, the reference itself is released.
VBA Copy codeCopy code
Dim xlApp As Object ' Declare variable to hold the reference.
Set xlApp = CreateObject("excel.application")
' You may have to set Visible property to True
' if you want to see the application.
xlApp.Visible = True
' Use xlApp to access Microsoft Excel's
' other objects.
***
Pour "OlApp.CreateItem(3)", je me sers du fichier d'aide Outlook (en
anglais aussi. Je peux te le faire parvenir, si tu es intéressé.
Cordialement.
Daniel
Daniel, une question sans grand rapport...
en VBS (pas VBA, mais je crois savoir que c'est pareil), comment
peut-on savoir quels objets on peut manipuler CreateObject("???") et
comment peut-on savoir ce qu'on peut faire avec ces objets comme
OlApp.CreateItem(3) ?
--
JièL homme objet non manipulable ;-)
Le 23/11/2016 à 11:11, DanielCo a écrit :
Bonjour,
Adapte le code suivant (j'ai mis une alerte 4 jours avant la date)
:
Sub CreerRappel()
Dim OlApp As Object, myItem As Object
Set OlApp = CreateObject("Outlook.Application")
Set myItem = OlApp.CreateItem(3)
myItem.Subject = "Rappel commande"
myItem.Body = Range("C4").Value
myItem.ReminderTime = Range("H4").Value - 4
myItem.DueDate = Range("H4").Value
myItem.ReminderSet = True
myItem.Display
End Sub
Cordialement.
Daniel
Bonjour, J'ai besoin d'aide... J'ai créé une liste de commande
sous
excel et j'aimerai faire un lien
automatique vers outlook pour avoir des rappels mes dates de
livraison
prévues -1. Beaucoup d’exemples sur la toile et je suis bien
novice
donc j’espère simplifier mon travail avec vous, car je n'ai pas
trouvé
de tuto la-dessus, bien sûr si c’est possible. Merci d’avance.
http://www.cjoint.com/c/FKwqoojyr0f
Avatar
JièL
Merci bôcoup, ça me donne déjà une bonne piste
la sainte axe est la même en VBS qu'en VBA, c'est juste que je ne sais
pas quels sont les objets ActiveX manipulable... Je continue à chercher.
Merci
--
JièL Saint taxe
Le 23/11/2016 à 12:28, DanielCo a écrit :
Bonjour JièL,
Désolé, je ne connais pas VBS. Je sens que je ne vais pas être d'une
grande aide pour CreateObject... Apparemment, tu mets des applications,
mais pas seulement, par exemple "fso > CreateObject("Scripting.FileSystemObject")"). Je te mets l'aide VBA (en
anglais, faute de mieux)
***
Creates and returns a reference to an ActiveX object.
Syntax
CreateObject( class,[servername] )
The CreateObject function syntax has these parts:
Part
Description
class
Required; Variant (String). The application name and class of the object
to create.
servername
Optional; Variant (String). The name of the network server where the
object will be created. If servername is an empty string (""), the local
machine is used.
The class argument uses the syntax appname.objecttype and has these parts:
Part
Description
appname
Required; Variant (String). The name of the application providing the
object.
objecttype
Required; Variant (String). The type or class of object to create.
Remarks
Every application that supports Automation provides at least one type of
object. For example, a word processing application may provide an
Application object, a Document object, and a Toolbar object.
To create an ActiveX object, assign the object returned by CreateObject
to an object variable:
VBA Copy codeCopy code
' Declare an object variable to hold the object
' reference. Dim as Object causes late binding.
Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")
This code starts the application creating the object, in this case, a
Microsoft Excel spreadsheet. Once an object is created, you reference it
in code using the object variable you defined. In the following example,
you access properties and methods of the new object using the object
variable, ExcelSheet, and other Microsoft Excel objects, including the
Application object and the Cells collection.
VBA Copy codeCopy code
' Make Excel visible through the Application object.
ExcelSheet.Application.Visible = True
' Place some text in the first cell of the sheet.
ExcelSheet.Application.Cells(1, 1).Value = "This is column A, row 1"
' Save the sheet to C:test.xls directory.
ExcelSheet.SaveAs "C:TEST.XLS"
' Close Excel with the Quit method on the Application object.
ExcelSheet.Application.Quit
' Release the object variable.
Set ExcelSheet = Nothing
Declaring an object variable with the As Object clause creates a
variable that can contain a reference to any type of object. However,
access to the object through that variable is late bound; that is, the
binding occurs when your program is run. To create an object variable
that results in early binding, that is, binding when the program is
compiled, declare the object variable with a specific class ID. For
example, you can declare and create the following Microsoft Excel
references:
VBA Copy codeCopy code
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.WorkSheet
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)
The reference through an early-bound variable can give better
performance, but can only contain a reference to the class specified in
the declaration.
You can pass an object returned by the CreateObject function to a
function expecting an object as an argument. For example, the following
code creates and passes a reference to a Excel.Application object:
VBA Copy codeCopy code
Call MySub (CreateObject("Excel.Application"))
You can create an object on a remote networked computer by passing the
name of the computer to the servername argument of CreateObject. That
name is the same as the Machine Name portion of a share name: for a
share named "MyServerPublic," servername is "MyServer."
Note Note
Refer to COM documentation (see Microsoft Developer Network) for
additional information on making an application visible on a remote
networked computer. You may have to add a registry key for your
application.
The following code returns the version number of an instance of Excel
running on a remote computer named MyServer:
VBA Copy codeCopy code
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application", "MyServer")
Debug.Print xlApp.Version
If the remote server doesn't exist or is unavailable, a run-time error
occurs.
Note Note
Use CreateObject when there is no current instance of the object. If an
instance of the object is already running, a new instance is started,
and an object of the specified type is created. To use the current
instance, or to start the application and have it load a file, use the
GetObject function.
If an object has registered itself as a single-instance object, only one
instance of the object is created, no matter how many times CreateObject
is executed.
Collapse sectionExample
This example uses the CreateObject function to set a reference (xlApp)
to Microsoft Excel. It uses the reference to access the Visible property
of Microsoft Excel, and then uses the Microsoft Excel Quit method to
close it. Finally, the reference itself is released.
VBA Copy codeCopy code
Dim xlApp As Object ' Declare variable to hold the reference.
Set xlApp = CreateObject("excel.application")
' You may have to set Visible property to True
' if you want to see the application.
xlApp.Visible = True
' Use xlApp to access Microsoft Excel's
' other objects.
***
Pour "OlApp.CreateItem(3)", je me sers du fichier d'aide Outlook (en
anglais aussi. Je peux te le faire parvenir, si tu es intéressé.
Cordialement.
Daniel
Daniel, une question sans grand rapport...
en VBS (pas VBA, mais je crois savoir que c'est pareil), comment
peut-on savoir quels objets on peut manipuler CreateObject("???") et
comment peut-on savoir ce qu'on peut faire avec ces objets comme
OlApp.CreateItem(3) ?
--
JièL homme objet non manipulable ;-)
Le 23/11/2016 à 11:11, DanielCo a écrit :
Bonjour,
Adapte le code suivant (j'ai mis une alerte 4 jours avant la date) :
Sub CreerRappel()
Dim OlApp As Object, myItem As Object
Set OlApp = CreateObject("Outlook.Application")
Set myItem = OlApp.CreateItem(3)
myItem.Subject = "Rappel commande"
myItem.Body = Range("C4").Value
myItem.ReminderTime = Range("H4").Value - 4
myItem.DueDate = Range("H4").Value
myItem.ReminderSet = True
myItem.Display
End Sub
Cordialement.
Daniel
Bonjour, J'ai besoin d'aide... J'ai créé une liste de commande sous
excel et j'aimerai faire un lien
automatique vers outlook pour avoir des rappels mes dates de livraison
prévues -1. Beaucoup d’exemples sur la toile et je suis bien novice
donc j’espère simplifier mon travail avec vous, car je n'ai pas trouvé
de tuto la-dessus, bien sûr si c’est possible. Merci d’avance.
http://www.cjoint.com/c/FKwqoojyr0f
Avatar
valoche54
Le mercredi 23 Novembre 2016 à 10:01 par Valoche54 :
Bonjour,
J'ai besoin d'aide...
J'ai créé une liste de commande sous excel et j'aimerai faire un
lien automatique vers outlook pour avoir des rappels mes dates de livraison
prévues -1.
Beaucoup d’exemples sur la toile et je suis bien novice donc
j’espère simplifier mon travail avec vous, car je n'ai pas
trouvé de tuto la-dessus, bien sûr si c’est possible.
Merci d’avance.
http://www.cjoint.com/c/FKwqoojyr0f
Bonjour Daniel,
C'est un super bon en avant.
Crois-tu que c'est possible que dés que j'ouvre le fichier excel en question cela active cette macro? car sinon je dois ajouter un bouton.
J'ai remplacé myitem.Display
par
myitem.save
Le rappel se fait mais ne mentionne pas l'objet et les fournisseurs des commandes.
Que peut-on faire pour cela?
Avatar
MichD
Bonjour,
À cette adresse, tu devras trouver toute l'information sur ce que tu peux faire dans un
VBscript :
http://www.indusoft.com/pdf/VBScript%20Reference.pdf
MichD
Avatar
valoche54
Le mercredi 23 Novembre 2016 à 10:01 par Valoche54 :
Bonjour,
J'ai besoin d'aide...
J'ai créé une liste de commande sous excel et j'aimerai faire un
lien automatique vers outlook pour avoir des rappels mes dates de livraison
prévues -1.
Beaucoup d’exemples sur la toile et je suis bien novice donc
j’espère simplifier mon travail avec vous, car je n'ai pas
trouvé de tuto la-dessus, bien sûr si c’est possible.
Merci d’avance.
http://www.cjoint.com/c/FKwqoojyr0f
Bonjour MichD,
merci pour ce lien, mais je suis mauvaise en anglais.
Si tu as le même truc en Français cela devrait aller mieux enfin presque car c'est tout nouveau pour moi.
Avatar
JièL
C'est une bonne doc, mais elle concerne aussi beaucoup Indusoft Web Studio
Merci.
--
JièL bonnedoc
Le 23/11/2016 à 14:03, MichD a écrit :
Bonjour,
À cette adresse, tu devras trouver toute l'information sur ce que tu
peux faire dans un VBscript :
http://www.indusoft.com/pdf/VBScript%20Reference.pdf
MichD
Avatar
MichD
Tu peux aussi utiliser un fichier d'aide sur VBScript et Java script de Microsoft
ainsi que fichier .vbs à titre d'exemple. Un clic droit sur ce dernier / Menu contextuel /
modifier / et dans
le haut du code, une description sommaire de ce que fait ce script.
http://www.cjoint.com/c/FKyooIo2LvR
MichD