Copier raccourci mdb sur c en VBA
Dernière réponse : dans Programmation
salut,
comment faire pour créer un raccourci d'une application access 97 en VBA et le copier sur le bureau par expemple.
merci en avance
aidez moi, SVP.
comment faire pour créer un raccourci d'une application access 97 en VBA et le copier sur le bureau par expemple.
merci en avance
aidez moi, SVP.
Autres pages sur : copier raccourci mdb vba
Lassé par la pub ? Créez un compte
Meilleure solution
Ben c'est pas mal du tout ce code. Il fonctionne en plus !
Sauf que tu ne précises pas où tu veux que soit enregistré ton lien.
Il est quelque part sur ton disque dur, mais ni toi, ni moi ne savons où (c'est dommage) !
Je te propose, à la ligne 7 de ton code, d'ajouter le chemin devant le nom du fichier.
C'est d'ailleurs en y pensant que je te proposais de te renseigner sur la méthode WshSpecialfolders()
Sauf que tu ne précises pas où tu veux que soit enregistré ton lien.
Il est quelque part sur ton disque dur, mais ni toi, ni moi ne savons où (c'est dommage) !
Je te propose, à la ligne 7 de ton code, d'ajouter le chemin devant le nom du fichier.
Set oShellLink = WSHShell.CreateShortcut("X:\chemin\Planning_Presse_Nawale.lnk" )
C'est d'ailleurs en y pensant que je te proposais de te renseigner sur la méthode WshSpecialfolders()
Salut,
merci de me répondre,
j'ai fais mes recherches sur ces deux méthodes : WshShortcut() et WshSpecialfolders() . j'ai trouvé ce code, mais j'ai des erreurs : le message d'erreurs :" le mot "Wscript" non définit"
. N.B. je travaille sur access 97.
Merci pour votre aide.
'Create a WshShell Object
Dim WSHShell
Set WSHShell = Wscript.CreateObject("Wscript.Shell")
'Create a WshShortcut Object
Dim oShellLink
Set oShellLink = WSHShell.CreateShortcut("Planning_Presse_Nawale.lnk")
'Set the Target Path for the shortcut
oShellLink.TargetPath = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
'Set the additional parameters for the shortcut
oShellLink.Arguments = "C:\Test_Planning\Code_Planning\Planning_Presse.mdb"
'Save the shortcut
oShellLink.Save
'Clean up the WshShortcut Object
Set oShellLink = Nothing
merci de me répondre,
j'ai fais mes recherches sur ces deux méthodes : WshShortcut() et WshSpecialfolders() . j'ai trouvé ce code, mais j'ai des erreurs : le message d'erreurs :" le mot "Wscript" non définit"
. N.B. je travaille sur access 97.Merci pour votre aide.
'Create a WshShell Object
Dim WSHShell
Set WSHShell = Wscript.CreateObject("Wscript.Shell")
'Create a WshShortcut Object
Dim oShellLink
Set oShellLink = WSHShell.CreateShortcut("Planning_Presse_Nawale.lnk")
'Set the Target Path for the shortcut
oShellLink.TargetPath = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
'Set the additional parameters for the shortcut
oShellLink.Arguments = "C:\Test_Planning\Code_Planning\Planning_Presse.mdb"
'Save the shortcut
oShellLink.Save
'Clean up the WshShortcut Object
Set oShellLink = Nothing
Salut,
désolée j'ai pas bien compris votre remarque, est ce que je dois mettre [code] devant chaque ligne écrite?. Le code que j'ai testé:
[code]
'Create a WshShell Object
Dim WSHShell
Set WSHShell = Wscript.CreateObject("Wscript.Shell" )
'Create a WshShortcut Object
Dim oShellLink
Set oShellLink = WSHShell.CreateShortcut("Planning_Presse_Nawale.lnk" )
'Set the Target Path for the shortcut
oShellLink.TargetPath = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
'Set the additional parameters for the shortcut
oShellLink.Arguments = "C:\Test_Planning\Code_Planning\Planning_Presse.mdb"
'Save the shortcut
oShellLink.Save
'Clean up the WshShortcut Object
Set oShellLink = Nothing
'-------------------------------------
je l'ai mis sur click d'un bouton.
Merci pour votre aide
désolée j'ai pas bien compris votre remarque, est ce que je dois mettre [code] devant chaque ligne écrite?. Le code que j'ai testé:
[code]
'Create a WshShell Object
Dim WSHShell
Set WSHShell = Wscript.CreateObject("Wscript.Shell" )
'Create a WshShortcut Object
Dim oShellLink
Set oShellLink = WSHShell.CreateShortcut("Planning_Presse_Nawale.lnk" )
'Set the Target Path for the shortcut
oShellLink.TargetPath = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
'Set the additional parameters for the shortcut
oShellLink.Arguments = "C:\Test_Planning\Code_Planning\Planning_Presse.mdb"
'Save the shortcut
oShellLink.Save
'Clean up the WshShortcut Object
Set oShellLink = Nothing
'-------------------------------------
je l'ai mis sur click d'un bouton.
Merci pour votre aide
Salut,
j'ai essayé de modifier mon ancien code pour résoudre le problème: mon nouveau code:
'-------------------------------------
mon nouveau code ne donne pas d'erreur mais je trouve pas le racourci à créer, je vois pas pourquoi ça marche pas.
Merci pour votre aide
j'ai essayé de modifier mon ancien code pour résoudre le problème: mon nouveau code:
'Create a WshShell Object
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
'Create a WshShortcut Object
Dim oShellLink
Set oShellLink = WSHShell.CreateShortcut("Planning_Presse_Nawale.lnk")
'Set the Target Path for the shortcut
oShellLink.TargetPath = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
'Set the additional parameters for the shortcut
oShellLink.Arguments = "C:\Test_Planning\Code_Planning\Planning_Presse.mdb"
'Save the shortcut
oShellLink.Save
'Clean up the WshShortcut Object
Set oShellLink = Nothing
'-------------------------------------
mon nouveau code ne donne pas d'erreur mais je trouve pas le racourci à créer, je vois pas pourquoi ça marche pas.
Merci pour votre aide
Lassé par la pub ? Créez un compte
- Contenus similaires :
Tags :