Bonjour
Le talentueux Jacky m'a fourni cette procédure qui créé un raccourci sur le
bureau
Est-il possible par VBA de changer l'icône du raccourci par VBA ?
Je vous remercie
Didier
Sub CreerRaccourci()
Set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Set oShellLink = WshShell.CreateShortcut(strDesktop & "\titre.lnk")
'**ici titre du raccourci**
oShellLink.TargetPath = "d:\chemin" '****Ici chemin complet de la
cible
oShellLink.WindowStyle = 1
oShellLink.Save
End Sub
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
michdenis
Bonjour Didier,
Voici une procédure publiée sur ce forum par Frédéric Sigonneau :
Tu peux faire varier le "1" cette ligne de code oShellLink.IconLocation = "shell32.dll, 1" de 1 à 20 environ.
Tu vas obtenir un des icônes de la liste, un clic droit sur ton raccourci clavier sur le bureau / propriétés / changer l'icône ...
oShellLink.IconLocation = "shell32.dll, 1"
Tu peux spécifier le fichier DLL d'où tu veux extraire ton icône en utilisant une ligne de code comme celle-ci : Insère chemin + Dll + numéro de l'icône oShellLink.IconLocation = "c:WindowsSystem32shell32.dll, 3" (cette façon de faire n'a pas été testé.
'--------------------------------- Sub CreationRaccourciSurLeBureau()
Set WshShell = CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") Set oShellLink = WshShell.CreateShortcut(strDesktop & "MonClasseur.lnk") oShellLink.TargetPath = sPath & sFile oShellLink.WindowStyle = 1 oShellLink.Hotkey = "CTRL+SHIFT+G" oShellLink.Description = "Session monfichier" oShellLink.IconLocation = "shell32.dll, 1" oShellLink.WorkingDirectory = sPath oShellLink.Save End Sub '---------------------------------
Salutations!
"Didier Novarin" a écrit dans le message de news: % Bonjour Le talentueux Jacky m'a fourni cette procédure qui créé un raccourci sur le bureau Est-il possible par VBA de changer l'icône du raccourci par VBA ? Je vous remercie Didier
Sub CreerRaccourci() Set WshShell = CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") Set oShellLink = WshShell.CreateShortcut(strDesktop & "titre.lnk") '**ici titre du raccourci** oShellLink.TargetPath = "d:chemin" '****Ici chemin complet de la cible oShellLink.WindowStyle = 1 oShellLink.Save End Sub
Bonjour Didier,
Voici une procédure publiée sur ce forum par Frédéric Sigonneau :
Tu peux faire varier le "1" cette ligne de code
oShellLink.IconLocation = "shell32.dll, 1" de 1 à 20 environ.
Tu vas obtenir un des icônes de la liste,
un clic droit sur ton raccourci clavier sur le bureau / propriétés / changer l'icône ...
oShellLink.IconLocation = "shell32.dll, 1"
Tu peux spécifier le fichier DLL d'où tu veux extraire ton icône en utilisant une
ligne de code comme celle-ci : Insère chemin + Dll + numéro de l'icône
oShellLink.IconLocation = "c:WindowsSystem32shell32.dll, 3"
(cette façon de faire n'a pas été testé.
'---------------------------------
Sub CreationRaccourciSurLeBureau()
Set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Set oShellLink = WshShell.CreateShortcut(strDesktop & "MonClasseur.lnk")
oShellLink.TargetPath = sPath & sFile
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+G"
oShellLink.Description = "Session monfichier"
oShellLink.IconLocation = "shell32.dll, 1"
oShellLink.WorkingDirectory = sPath
oShellLink.Save
End Sub
'---------------------------------
Salutations!
"Didier Novarin" <didier.n@club-internet.fr> a écrit dans le message de news: %23cK46861FHA.460@TK2MSFTNGP15.phx.gbl...
Bonjour
Le talentueux Jacky m'a fourni cette procédure qui créé un raccourci sur le
bureau
Est-il possible par VBA de changer l'icône du raccourci par VBA ?
Je vous remercie
Didier
Sub CreerRaccourci()
Set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Set oShellLink = WshShell.CreateShortcut(strDesktop & "titre.lnk")
'**ici titre du raccourci**
oShellLink.TargetPath = "d:chemin" '****Ici chemin complet de la
cible
oShellLink.WindowStyle = 1
oShellLink.Save
End Sub
Voici une procédure publiée sur ce forum par Frédéric Sigonneau :
Tu peux faire varier le "1" cette ligne de code oShellLink.IconLocation = "shell32.dll, 1" de 1 à 20 environ.
Tu vas obtenir un des icônes de la liste, un clic droit sur ton raccourci clavier sur le bureau / propriétés / changer l'icône ...
oShellLink.IconLocation = "shell32.dll, 1"
Tu peux spécifier le fichier DLL d'où tu veux extraire ton icône en utilisant une ligne de code comme celle-ci : Insère chemin + Dll + numéro de l'icône oShellLink.IconLocation = "c:WindowsSystem32shell32.dll, 3" (cette façon de faire n'a pas été testé.
'--------------------------------- Sub CreationRaccourciSurLeBureau()
Set WshShell = CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") Set oShellLink = WshShell.CreateShortcut(strDesktop & "MonClasseur.lnk") oShellLink.TargetPath = sPath & sFile oShellLink.WindowStyle = 1 oShellLink.Hotkey = "CTRL+SHIFT+G" oShellLink.Description = "Session monfichier" oShellLink.IconLocation = "shell32.dll, 1" oShellLink.WorkingDirectory = sPath oShellLink.Save End Sub '---------------------------------
Salutations!
"Didier Novarin" a écrit dans le message de news: % Bonjour Le talentueux Jacky m'a fourni cette procédure qui créé un raccourci sur le bureau Est-il possible par VBA de changer l'icône du raccourci par VBA ? Je vous remercie Didier
Sub CreerRaccourci() Set WshShell = CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") Set oShellLink = WshShell.CreateShortcut(strDesktop & "titre.lnk") '**ici titre du raccourci** oShellLink.TargetPath = "d:chemin" '****Ici chemin complet de la cible oShellLink.WindowStyle = 1 oShellLink.Save End Sub
Didier Novarin
Bonsoir Denis Rien à dire remarquable !!!! Merci BEAUCOUP Très bonne soirée Didier
"michdenis" a écrit dans le message de news:
Bonjour Didier,
Voici une procédure publiée sur ce forum par Frédéric Sigonneau :
Tu peux faire varier le "1" cette ligne de code oShellLink.IconLocation = "shell32.dll, 1" de 1 à 20 environ.
Tu vas obtenir un des icônes de la liste, un clic droit sur ton raccourci clavier sur le bureau / propriétés / changer l'icône ...
oShellLink.IconLocation = "shell32.dll, 1"
Tu peux spécifier le fichier DLL d'où tu veux extraire ton icône en utilisant une ligne de code comme celle-ci : Insère chemin + Dll + numéro de l'icône oShellLink.IconLocation = "c:WindowsSystem32shell32.dll, 3" (cette façon de faire n'a pas été testé.
'--------------------------------- Sub CreationRaccourciSurLeBureau()
Set WshShell = CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") Set oShellLink = WshShell.CreateShortcut(strDesktop & "MonClasseur.lnk") oShellLink.TargetPath = sPath & sFile oShellLink.WindowStyle = 1 oShellLink.Hotkey = "CTRL+SHIFT+G" oShellLink.Description = "Session monfichier" oShellLink.IconLocation = "shell32.dll, 1" oShellLink.WorkingDirectory = sPath oShellLink.Save End Sub '---------------------------------
Salutations!
"Didier Novarin" a écrit dans le message de news: % Bonjour Le talentueux Jacky m'a fourni cette procédure qui créé un raccourci sur le bureau Est-il possible par VBA de changer l'icône du raccourci par VBA ? Je vous remercie Didier
Sub CreerRaccourci() Set WshShell = CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") Set oShellLink = WshShell.CreateShortcut(strDesktop & "titre.lnk") '**ici titre du raccourci** oShellLink.TargetPath = "d:chemin" '****Ici chemin complet de la cible oShellLink.WindowStyle = 1 oShellLink.Save End Sub
Bonsoir Denis
Rien à dire remarquable !!!!
Merci BEAUCOUP
Très bonne soirée
Didier
"michdenis" <michdenis@hotmail.com> a écrit dans le message de news:
OTatwL91FHA.2964@TK2MSFTNGP09.phx.gbl...
Bonjour Didier,
Voici une procédure publiée sur ce forum par Frédéric Sigonneau :
Tu peux faire varier le "1" cette ligne de code
oShellLink.IconLocation = "shell32.dll, 1" de 1 à 20 environ.
Tu vas obtenir un des icônes de la liste,
un clic droit sur ton raccourci clavier sur le bureau / propriétés /
changer l'icône ...
oShellLink.IconLocation = "shell32.dll, 1"
Tu peux spécifier le fichier DLL d'où tu veux extraire ton icône en
utilisant une
ligne de code comme celle-ci : Insère chemin + Dll + numéro de l'icône
oShellLink.IconLocation = "c:WindowsSystem32shell32.dll, 3"
(cette façon de faire n'a pas été testé.
'---------------------------------
Sub CreationRaccourciSurLeBureau()
Set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Set oShellLink = WshShell.CreateShortcut(strDesktop & "MonClasseur.lnk")
oShellLink.TargetPath = sPath & sFile
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+G"
oShellLink.Description = "Session monfichier"
oShellLink.IconLocation = "shell32.dll, 1"
oShellLink.WorkingDirectory = sPath
oShellLink.Save
End Sub
'---------------------------------
Salutations!
"Didier Novarin" <didier.n@club-internet.fr> a écrit dans le message de
news: %23cK46861FHA.460@TK2MSFTNGP15.phx.gbl...
Bonjour
Le talentueux Jacky m'a fourni cette procédure qui créé un raccourci sur
le
bureau
Est-il possible par VBA de changer l'icône du raccourci par VBA ?
Je vous remercie
Didier
Sub CreerRaccourci()
Set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Set oShellLink = WshShell.CreateShortcut(strDesktop & "titre.lnk")
'**ici titre du raccourci**
oShellLink.TargetPath = "d:chemin" '****Ici chemin complet de la
cible
oShellLink.WindowStyle = 1
oShellLink.Save
End Sub
Bonsoir Denis Rien à dire remarquable !!!! Merci BEAUCOUP Très bonne soirée Didier
"michdenis" a écrit dans le message de news:
Bonjour Didier,
Voici une procédure publiée sur ce forum par Frédéric Sigonneau :
Tu peux faire varier le "1" cette ligne de code oShellLink.IconLocation = "shell32.dll, 1" de 1 à 20 environ.
Tu vas obtenir un des icônes de la liste, un clic droit sur ton raccourci clavier sur le bureau / propriétés / changer l'icône ...
oShellLink.IconLocation = "shell32.dll, 1"
Tu peux spécifier le fichier DLL d'où tu veux extraire ton icône en utilisant une ligne de code comme celle-ci : Insère chemin + Dll + numéro de l'icône oShellLink.IconLocation = "c:WindowsSystem32shell32.dll, 3" (cette façon de faire n'a pas été testé.
'--------------------------------- Sub CreationRaccourciSurLeBureau()
Set WshShell = CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") Set oShellLink = WshShell.CreateShortcut(strDesktop & "MonClasseur.lnk") oShellLink.TargetPath = sPath & sFile oShellLink.WindowStyle = 1 oShellLink.Hotkey = "CTRL+SHIFT+G" oShellLink.Description = "Session monfichier" oShellLink.IconLocation = "shell32.dll, 1" oShellLink.WorkingDirectory = sPath oShellLink.Save End Sub '---------------------------------
Salutations!
"Didier Novarin" a écrit dans le message de news: % Bonjour Le talentueux Jacky m'a fourni cette procédure qui créé un raccourci sur le bureau Est-il possible par VBA de changer l'icône du raccourci par VBA ? Je vous remercie Didier
Sub CreerRaccourci() Set WshShell = CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") Set oShellLink = WshShell.CreateShortcut(strDesktop & "titre.lnk") '**ici titre du raccourci** oShellLink.TargetPath = "d:chemin" '****Ici chemin complet de la cible oShellLink.WindowStyle = 1 oShellLink.Save End Sub