Je voudrais créer un nouveau dossier dans c:TOTO et ensuite creer un
raccourci du nouveau dossier sur le bureau.
Sub Creer()
No = Range("A1").Value
Da = Range("A2").Value
MkDir "C:\TOTO\" & No & "(" & Da & ")"
' Je suis rendu là
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
Sonic
Bonjour.
Sub Creer() Dim no As String Dim da As String Dim chemin As String Dim nom As String Dim Commentaire As String
no = Feuil1.Range("A1").Value da = Feuil1.Range("A2").Value chemin = "C:TOTO" & no & "(" & da & ")" nom = no & "(" & da & ")" & ".Lnk" Commentaire = chemin
MkDir chemin ' Je suis rendu là RaccourciSurBureau nom, chemin, , , , Commentaire End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom) Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
"MK" wrote in message news:
Bonjour
Je voudrais créer un nouveau dossier dans c:TOTO et ensuite creer un raccourci du nouveau dossier sur le bureau. Sub Creer() No = Range("A1").Value Da = Range("A2").Value MkDir "C:TOTO" & No & "(" & Da & ")" ' Je suis rendu là End Sub
Merci beaucoup de votre aide
MK
Bonjour.
Sub Creer()
Dim no As String
Dim da As String
Dim chemin As String
Dim nom As String
Dim Commentaire As String
no = Feuil1.Range("A1").Value
da = Feuil1.Range("A2").Value
chemin = "C:TOTO" & no & "(" & da & ")"
nom = no & "(" & da & ")" & ".Lnk"
Commentaire = chemin
MkDir chemin
' Je suis rendu là
RaccourciSurBureau nom, chemin, , , , Commentaire
End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _
Optional sParam As String, Optional sRepertoireDeTravail As String, _
Optional sIcon As String, Optional sComment As String)
Dim OBJ As Object, oShellLink As Object
Set OBJ = CreateObject("wscript.shell")
Set oShellLink = OBJ.CreateShortcut(sNom)
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & ""
& sNom)
With oShellLink
.TargetPath = sChemin
.Arguments = sParam
.WorkingDirectory = sRepertoireDeTravail
If sIcon = "" Then sIcon = sChemin
.IconLocation = sIcon
.Description = sComment
.Save
End With
End Function
"MK" <MK@discussions.microsoft.com> wrote in message
news:C6E4367C-BF44-4550-BF3B-FC2DC3BF4DD0@microsoft.com...
Bonjour
Je voudrais créer un nouveau dossier dans c:TOTO et ensuite creer un
raccourci du nouveau dossier sur le bureau.
Sub Creer()
No = Range("A1").Value
Da = Range("A2").Value
MkDir "C:TOTO" & No & "(" & Da & ")"
' Je suis rendu là
End Sub
Sub Creer() Dim no As String Dim da As String Dim chemin As String Dim nom As String Dim Commentaire As String
no = Feuil1.Range("A1").Value da = Feuil1.Range("A2").Value chemin = "C:TOTO" & no & "(" & da & ")" nom = no & "(" & da & ")" & ".Lnk" Commentaire = chemin
MkDir chemin ' Je suis rendu là RaccourciSurBureau nom, chemin, , , , Commentaire End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom) Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
"MK" wrote in message news:
Bonjour
Je voudrais créer un nouveau dossier dans c:TOTO et ensuite creer un raccourci du nouveau dossier sur le bureau. Sub Creer() No = Range("A1").Value Da = Range("A2").Value MkDir "C:TOTO" & No & "(" & Da & ")" ' Je suis rendu là End Sub
Merci beaucoup de votre aide
MK
MK
Merci,mais j'ai un bug avec cette ligne.
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
Bonjour.
Sub Creer() Dim no As String Dim da As String Dim chemin As String Dim nom As String Dim Commentaire As String
no = Feuil1.Range("A1").Value da = Feuil1.Range("A2").Value chemin = "C:TOTO" & no & "(" & da & ")" nom = no & "(" & da & ")" & ".Lnk" Commentaire = chemin
MkDir chemin ' Je suis rendu là RaccourciSurBureau nom, chemin, , , , Commentaire End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom) Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
"MK" wrote in message news:
Bonjour
Je voudrais créer un nouveau dossier dans c:TOTO et ensuite creer un raccourci du nouveau dossier sur le bureau. Sub Creer() No = Range("A1").Value Da = Range("A2").Value MkDir "C:TOTO" & No & "(" & Da & ")" ' Je suis rendu là End Sub
Merci beaucoup de votre aide
MK
Merci,mais j'ai un bug avec cette ligne.
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & ""
& sNom)
Bonjour.
Sub Creer()
Dim no As String
Dim da As String
Dim chemin As String
Dim nom As String
Dim Commentaire As String
no = Feuil1.Range("A1").Value
da = Feuil1.Range("A2").Value
chemin = "C:TOTO" & no & "(" & da & ")"
nom = no & "(" & da & ")" & ".Lnk"
Commentaire = chemin
MkDir chemin
' Je suis rendu là
RaccourciSurBureau nom, chemin, , , , Commentaire
End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _
Optional sParam As String, Optional sRepertoireDeTravail As String, _
Optional sIcon As String, Optional sComment As String)
Dim OBJ As Object, oShellLink As Object
Set OBJ = CreateObject("wscript.shell")
Set oShellLink = OBJ.CreateShortcut(sNom)
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & ""
& sNom)
With oShellLink
.TargetPath = sChemin
.Arguments = sParam
.WorkingDirectory = sRepertoireDeTravail
If sIcon = "" Then sIcon = sChemin
.IconLocation = sIcon
.Description = sComment
.Save
End With
End Function
"MK" <MK@discussions.microsoft.com> wrote in message
news:C6E4367C-BF44-4550-BF3B-FC2DC3BF4DD0@microsoft.com...
Bonjour
Je voudrais créer un nouveau dossier dans c:TOTO et ensuite creer un
raccourci du nouveau dossier sur le bureau.
Sub Creer()
No = Range("A1").Value
Da = Range("A2").Value
MkDir "C:TOTO" & No & "(" & Da & ")"
' Je suis rendu là
End Sub
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
Bonjour.
Sub Creer() Dim no As String Dim da As String Dim chemin As String Dim nom As String Dim Commentaire As String
no = Feuil1.Range("A1").Value da = Feuil1.Range("A2").Value chemin = "C:TOTO" & no & "(" & da & ")" nom = no & "(" & da & ")" & ".Lnk" Commentaire = chemin
MkDir chemin ' Je suis rendu là RaccourciSurBureau nom, chemin, , , , Commentaire End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom) Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
"MK" wrote in message news:
Bonjour
Je voudrais créer un nouveau dossier dans c:TOTO et ensuite creer un raccourci du nouveau dossier sur le bureau. Sub Creer() No = Range("A1").Value Da = Range("A2").Value MkDir "C:TOTO" & No & "(" & Da & ")" ' Je suis rendu là End Sub
Merci beaucoup de votre aide
MK
MK
Désolé Sonic j'ai fait une erreur dans la copie. Ça fonctionne à merveille.
Sur la même ligne dans VBA. Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
Merci beaucoup
MK
Merci,mais j'ai un bug avec cette ligne.
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
Bonjour.
Sub Creer() Dim no As String Dim da As String Dim chemin As String Dim nom As String Dim Commentaire As String
no = Feuil1.Range("A1").Value da = Feuil1.Range("A2").Value chemin = "C:TOTO" & no & "(" & da & ")" nom = no & "(" & da & ")" & ".Lnk" Commentaire = chemin
MkDir chemin ' Je suis rendu là RaccourciSurBureau nom, chemin, , , , Commentaire End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom) Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
"MK" wrote in message news:
Bonjour
Je voudrais créer un nouveau dossier dans c:TOTO et ensuite creer un raccourci du nouveau dossier sur le bureau. Sub Creer() No = Range("A1").Value Da = Range("A2").Value MkDir "C:TOTO" & No & "(" & Da & ")" ' Je suis rendu là End Sub
Merci beaucoup de votre aide
MK
Désolé Sonic j'ai fait une erreur dans la copie. Ça fonctionne à merveille.
Sur la même ligne dans VBA.
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" &
sNom)
Merci beaucoup
MK
Merci,mais j'ai un bug avec cette ligne.
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & ""
& sNom)
Bonjour.
Sub Creer()
Dim no As String
Dim da As String
Dim chemin As String
Dim nom As String
Dim Commentaire As String
no = Feuil1.Range("A1").Value
da = Feuil1.Range("A2").Value
chemin = "C:TOTO" & no & "(" & da & ")"
nom = no & "(" & da & ")" & ".Lnk"
Commentaire = chemin
MkDir chemin
' Je suis rendu là
RaccourciSurBureau nom, chemin, , , , Commentaire
End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _
Optional sParam As String, Optional sRepertoireDeTravail As String, _
Optional sIcon As String, Optional sComment As String)
Dim OBJ As Object, oShellLink As Object
Set OBJ = CreateObject("wscript.shell")
Set oShellLink = OBJ.CreateShortcut(sNom)
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & ""
& sNom)
With oShellLink
.TargetPath = sChemin
.Arguments = sParam
.WorkingDirectory = sRepertoireDeTravail
If sIcon = "" Then sIcon = sChemin
.IconLocation = sIcon
.Description = sComment
.Save
End With
End Function
"MK" <MK@discussions.microsoft.com> wrote in message
news:C6E4367C-BF44-4550-BF3B-FC2DC3BF4DD0@microsoft.com...
Bonjour
Je voudrais créer un nouveau dossier dans c:TOTO et ensuite creer un
raccourci du nouveau dossier sur le bureau.
Sub Creer()
No = Range("A1").Value
Da = Range("A2").Value
MkDir "C:TOTO" & No & "(" & Da & ")"
' Je suis rendu là
End Sub
Désolé Sonic j'ai fait une erreur dans la copie. Ça fonctionne à merveille.
Sur la même ligne dans VBA. Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
Merci beaucoup
MK
Merci,mais j'ai un bug avec cette ligne.
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
Bonjour.
Sub Creer() Dim no As String Dim da As String Dim chemin As String Dim nom As String Dim Commentaire As String
no = Feuil1.Range("A1").Value da = Feuil1.Range("A2").Value chemin = "C:TOTO" & no & "(" & da & ")" nom = no & "(" & da & ")" & ".Lnk" Commentaire = chemin
MkDir chemin ' Je suis rendu là RaccourciSurBureau nom, chemin, , , , Commentaire End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom) Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
"MK" wrote in message news:
Bonjour
Je voudrais créer un nouveau dossier dans c:TOTO et ensuite creer un raccourci du nouveau dossier sur le bureau. Sub Creer() No = Range("A1").Value Da = Range("A2").Value MkDir "C:TOTO" & No & "(" & Da & ")" ' Je suis rendu là End Sub
Merci beaucoup de votre aide
MK
MK
Bonjour, ça fonctionne très bien mais si je veux envoyer le raccourci dans un autre folder.
Dim dos As String
dos = "C:Raccourci" & no ' ou autre chemin
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders(dos) & "" & sNom) 'mais ça fonctionne pas
Merci beaucoup de ton aide MK
Bonjour, ça fonctionne très bien mais si je veux envoyer le raccourci dans
un autre folder.
Dim dos As String
dos = "C:Raccourci" & no ' ou autre chemin
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders(dos) & "" & sNom)
'mais ça fonctionne pas
Bonjour, ça fonctionne très bien mais si je veux envoyer le raccourci dans un autre folder.
Dim dos As String
dos = "C:Raccourci" & no ' ou autre chemin
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders(dos) & "" & sNom) 'mais ça fonctionne pas
Merci beaucoup de ton aide MK
Sonic
Sub Creer() Dim no As String Dim da As String Dim chemin As String Dim nom As String Dim Commentaire As String Dim CheminDuLien As String
no = Feuil1.Range("A1").Value da = Feuil1.Range("A2").Value chemin = "C:TOTO" & no & "(" & da & ")" nom = no & "(" & da & ")" & ".Lnk" Commentaire = chemin
MkDir chemin ' Je suis rendu là RaccourciSurBureau nom, chemin, , , , Commentaire
CheminDuLien = "C:" & nom
Raccourci CheminDuLien, chemin, , , , Commentaire
End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom) Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
Function Raccourci(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
"MK" wrote in message news:
Bonjour, ça fonctionne très bien mais si je veux envoyer le raccourci dans un autre folder.
Dim dos As String
dos = "C:Raccourci" & no ' ou autre chemin
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders(dos) & "" & sNom) 'mais ça fonctionne pas
Merci beaucoup de ton aide MK
Sub Creer()
Dim no As String
Dim da As String
Dim chemin As String
Dim nom As String
Dim Commentaire As String
Dim CheminDuLien As String
no = Feuil1.Range("A1").Value
da = Feuil1.Range("A2").Value
chemin = "C:TOTO" & no & "(" & da & ")"
nom = no & "(" & da & ")" & ".Lnk"
Commentaire = chemin
MkDir chemin
' Je suis rendu là
RaccourciSurBureau nom, chemin, , , , Commentaire
CheminDuLien = "C:" & nom
Raccourci CheminDuLien, chemin, , , , Commentaire
End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _
Optional sParam As String, Optional sRepertoireDeTravail As String, _
Optional sIcon As String, Optional sComment As String)
Dim OBJ As Object, oShellLink As Object
Set OBJ = CreateObject("wscript.shell")
Set oShellLink = OBJ.CreateShortcut(sNom)
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & ""
& sNom)
With oShellLink
.TargetPath = sChemin
.Arguments = sParam
.WorkingDirectory = sRepertoireDeTravail
If sIcon = "" Then sIcon = sChemin
.IconLocation = sIcon
.Description = sComment
.Save
End With
End Function
Function Raccourci(sNom As String, sChemin As String, _
Optional sParam As String, Optional sRepertoireDeTravail As String, _
Optional sIcon As String, Optional sComment As String)
Dim OBJ As Object, oShellLink As Object
Set OBJ = CreateObject("wscript.shell")
Set oShellLink = OBJ.CreateShortcut(sNom)
With oShellLink
.TargetPath = sChemin
.Arguments = sParam
.WorkingDirectory = sRepertoireDeTravail
If sIcon = "" Then sIcon = sChemin
.IconLocation = sIcon
.Description = sComment
.Save
End With
End Function
"MK" <MK@discussions.microsoft.com> wrote in message
news:94878E2B-DC23-4F96-9692-ACC67C57ADCF@microsoft.com...
Bonjour, ça fonctionne très bien mais si je veux envoyer le raccourci dans
un autre folder.
Dim dos As String
dos = "C:Raccourci" & no ' ou autre chemin
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders(dos) & "" & sNom)
'mais ça fonctionne pas
Sub Creer() Dim no As String Dim da As String Dim chemin As String Dim nom As String Dim Commentaire As String Dim CheminDuLien As String
no = Feuil1.Range("A1").Value da = Feuil1.Range("A2").Value chemin = "C:TOTO" & no & "(" & da & ")" nom = no & "(" & da & ")" & ".Lnk" Commentaire = chemin
MkDir chemin ' Je suis rendu là RaccourciSurBureau nom, chemin, , , , Commentaire
CheminDuLien = "C:" & nom
Raccourci CheminDuLien, chemin, , , , Commentaire
End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom) Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
Function Raccourci(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
"MK" wrote in message news:
Bonjour, ça fonctionne très bien mais si je veux envoyer le raccourci dans un autre folder.
Dim dos As String
dos = "C:Raccourci" & no ' ou autre chemin
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders(dos) & "" & sNom) 'mais ça fonctionne pas
Merci beaucoup de ton aide MK
MK
Merci de ton aide.
MK
Sub Creer() Dim no As String Dim da As String Dim chemin As String Dim nom As String Dim Commentaire As String Dim CheminDuLien As String
no = Feuil1.Range("A1").Value da = Feuil1.Range("A2").Value chemin = "C:TOTO" & no & "(" & da & ")" nom = no & "(" & da & ")" & ".Lnk" Commentaire = chemin
MkDir chemin ' Je suis rendu là RaccourciSurBureau nom, chemin, , , , Commentaire
CheminDuLien = "C:" & nom
Raccourci CheminDuLien, chemin, , , , Commentaire
End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom) Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
Function Raccourci(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
"MK" wrote in message news:
Bonjour, ça fonctionne très bien mais si je veux envoyer le raccourci dans un autre folder.
Dim dos As String
dos = "C:Raccourci" & no ' ou autre chemin
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders(dos) & "" & sNom) 'mais ça fonctionne pas
Merci beaucoup de ton aide MK
Merci de ton aide.
MK
Sub Creer()
Dim no As String
Dim da As String
Dim chemin As String
Dim nom As String
Dim Commentaire As String
Dim CheminDuLien As String
no = Feuil1.Range("A1").Value
da = Feuil1.Range("A2").Value
chemin = "C:TOTO" & no & "(" & da & ")"
nom = no & "(" & da & ")" & ".Lnk"
Commentaire = chemin
MkDir chemin
' Je suis rendu là
RaccourciSurBureau nom, chemin, , , , Commentaire
CheminDuLien = "C:" & nom
Raccourci CheminDuLien, chemin, , , , Commentaire
End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _
Optional sParam As String, Optional sRepertoireDeTravail As String, _
Optional sIcon As String, Optional sComment As String)
Dim OBJ As Object, oShellLink As Object
Set OBJ = CreateObject("wscript.shell")
Set oShellLink = OBJ.CreateShortcut(sNom)
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & ""
& sNom)
With oShellLink
.TargetPath = sChemin
.Arguments = sParam
.WorkingDirectory = sRepertoireDeTravail
If sIcon = "" Then sIcon = sChemin
.IconLocation = sIcon
.Description = sComment
.Save
End With
End Function
Function Raccourci(sNom As String, sChemin As String, _
Optional sParam As String, Optional sRepertoireDeTravail As String, _
Optional sIcon As String, Optional sComment As String)
Dim OBJ As Object, oShellLink As Object
Set OBJ = CreateObject("wscript.shell")
Set oShellLink = OBJ.CreateShortcut(sNom)
With oShellLink
.TargetPath = sChemin
.Arguments = sParam
.WorkingDirectory = sRepertoireDeTravail
If sIcon = "" Then sIcon = sChemin
.IconLocation = sIcon
.Description = sComment
.Save
End With
End Function
"MK" <MK@discussions.microsoft.com> wrote in message
news:94878E2B-DC23-4F96-9692-ACC67C57ADCF@microsoft.com...
Bonjour, ça fonctionne très bien mais si je veux envoyer le raccourci dans
un autre folder.
Dim dos As String
dos = "C:Raccourci" & no ' ou autre chemin
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders(dos) & "" & sNom)
'mais ça fonctionne pas
Sub Creer() Dim no As String Dim da As String Dim chemin As String Dim nom As String Dim Commentaire As String Dim CheminDuLien As String
no = Feuil1.Range("A1").Value da = Feuil1.Range("A2").Value chemin = "C:TOTO" & no & "(" & da & ")" nom = no & "(" & da & ")" & ".Lnk" Commentaire = chemin
MkDir chemin ' Je suis rendu là RaccourciSurBureau nom, chemin, , , , Commentaire
CheminDuLien = "C:" & nom
Raccourci CheminDuLien, chemin, , , , Commentaire
End Sub
Function RaccourciSurBureau(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom) Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders("Desktop") & "" & sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
Function Raccourci(sNom As String, sChemin As String, _ Optional sParam As String, Optional sRepertoireDeTravail As String, _ Optional sIcon As String, Optional sComment As String) Dim OBJ As Object, oShellLink As Object Set OBJ = CreateObject("wscript.shell") Set oShellLink = OBJ.CreateShortcut(sNom)
With oShellLink .TargetPath = sChemin .Arguments = sParam .WorkingDirectory = sRepertoireDeTravail If sIcon = "" Then sIcon = sChemin .IconLocation = sIcon .Description = sComment .Save End With End Function
"MK" wrote in message news:
Bonjour, ça fonctionne très bien mais si je veux envoyer le raccourci dans un autre folder.
Dim dos As String
dos = "C:Raccourci" & no ' ou autre chemin
Set oShellLink = OBJ.CreateShortcut(OBJ.SpecialFolders(dos) & "" & sNom) 'mais ça fonctionne pas