PC Review


Reply
Thread Tools Rate Thread

adding shortcut to Quick Launch

 
 
Michelle
Guest
Posts: n/a
 
      2nd Dec 2008
Hi!
Now that I can delete and recreate a shortcut on the users desktop, can I
also delete and create one on their Quick Launch toolbar as well? They have
the correct shortcut on their desktop but when they initiate the Quick Launch
shortcut they have the wrong shortcut! Thank you so much for your help!
By the way I often have trouble posting a question or reply on your form. I
comes up blank and I can't post.

Function DeleteAndRecreateShortcut()

Dim WSHShell As Object
Dim MyShortCut As Object
Dim DesktopPath As String
Dim myFileName As String
Dim TestStr As String

Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
myFileName = DesktopPath & "\" & "Markup Spreadsheet" & ".lnk"

'Check to see if shortcut exists. If true, delete it.

TestStr = ""
On Error Resume Next
TestStr = Dir(myFileName)
On Error GoTo 0

If TestStr = "" Then
'doesn't exist
Else
'won't hurt if it's not read only, either.
SetAttr pathname:=myFileName, Attributes:=vbNormal
Kill pathname:=myFileName
End If

'Create new shortcut for users desktop

Set MyShortCut = WSHShell.CreateShortcut(myFileName)
With MyShortCut
.TargetPath = _
"\\Bwes.net\Barberton file
shares\DocControlPLM\BatchLoadFiles\ScriptsAndZips\Shortcuts\Markup
Spreadsheet.lnk"
.Description = "Markup Spreadsheet"
.Save
End With


Set WSHShell = Nothing
MsgBox "The MARKUP SPREADSHEET shortcut has been placed on your desktop"
& vbCrLf & _
"The shortcut has the same properties as the old shortcut:" &
vbCrLf & _
" - the shortcut is identified by a Gold Star" & vbCrLf & _
" - the shortcut title reads 'Markup Spreadsheet'" & vbCrLf &
vbCrLf & _
" On OK, this worksheet will close" & vbCrLf & _
" Then relaunch the MARKUP spreadsheet from the Desktop shortcut"
Workbooks("Document Control Markup.xls").Close SaveChanges:=False

End Function

 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      2nd Dec 2008
Once you have the DesktopPath, you can get the path to the QuickLaunch Folder
with simple string manipulation:

Sub liminal()
Dim WSHShell As Object
Dim MyShortCut As Object
Dim DesktopPath As String
Dim myFileName As String, s2 As String
Dim TestStr As String, s1 As String
Dim QuickPath As String

Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
MsgBox (DesktopPath)

s1 = "Desktop"
s2 = "Application Data\Microsoft\Internet Explorer\Quick Launch"
QuickPath = Replace(DesktopPath, s1, s2)
MsgBox (QuickPath)
End Sub
--
Gary''s Student - gsnu200817


"Michelle" wrote:

> Hi!
> Now that I can delete and recreate a shortcut on the users desktop, can I
> also delete and create one on their Quick Launch toolbar as well? They have
> the correct shortcut on their desktop but when they initiate the Quick Launch
> shortcut they have the wrong shortcut! Thank you so much for your help!
> By the way I often have trouble posting a question or reply on your form. I
> comes up blank and I can't post.
>
> Function DeleteAndRecreateShortcut()
>
> Dim WSHShell As Object
> Dim MyShortCut As Object
> Dim DesktopPath As String
> Dim myFileName As String
> Dim TestStr As String
>
> Set WSHShell = CreateObject("WScript.Shell")
> DesktopPath = WSHShell.SpecialFolders("Desktop")
> myFileName = DesktopPath & "\" & "Markup Spreadsheet" & ".lnk"
>
> 'Check to see if shortcut exists. If true, delete it.
>
> TestStr = ""
> On Error Resume Next
> TestStr = Dir(myFileName)
> On Error GoTo 0
>
> If TestStr = "" Then
> 'doesn't exist
> Else
> 'won't hurt if it's not read only, either.
> SetAttr pathname:=myFileName, Attributes:=vbNormal
> Kill pathname:=myFileName
> End If
>
> 'Create new shortcut for users desktop
>
> Set MyShortCut = WSHShell.CreateShortcut(myFileName)
> With MyShortCut
> .TargetPath = _
> "\\Bwes.net\Barberton file
> shares\DocControlPLM\BatchLoadFiles\ScriptsAndZips\Shortcuts\Markup
> Spreadsheet.lnk"
> .Description = "Markup Spreadsheet"
> .Save
> End With
>
>
> Set WSHShell = Nothing
> MsgBox "The MARKUP SPREADSHEET shortcut has been placed on your desktop"
> & vbCrLf & _
> "The shortcut has the same properties as the old shortcut:" &
> vbCrLf & _
> " - the shortcut is identified by a Gold Star" & vbCrLf & _
> " - the shortcut title reads 'Markup Spreadsheet'" & vbCrLf &
> vbCrLf & _
> " On OK, this worksheet will close" & vbCrLf & _
> " Then relaunch the MARKUP spreadsheet from the Desktop shortcut"
> Workbooks("Document Control Markup.xls").Close SaveChanges:=False
>
> End Function
>

 
Reply With Quote
 
Michelle
Guest
Posts: n/a
 
      2nd Dec 2008
Thank You Gary''s Student! You are a gentleman(woman) AND a scholar!
That was most helpful.

"Gary''s Student" wrote:

> Once you have the DesktopPath, you can get the path to the QuickLaunch Folder
> with simple string manipulation:
>
> Sub liminal()
> Dim WSHShell As Object
> Dim MyShortCut As Object
> Dim DesktopPath As String
> Dim myFileName As String, s2 As String
> Dim TestStr As String, s1 As String
> Dim QuickPath As String
>
> Set WSHShell = CreateObject("WScript.Shell")
> DesktopPath = WSHShell.SpecialFolders("Desktop")
> MsgBox (DesktopPath)
>
> s1 = "Desktop"
> s2 = "Application Data\Microsoft\Internet Explorer\Quick Launch"
> QuickPath = Replace(DesktopPath, s1, s2)
> MsgBox (QuickPath)
> End Sub
> --
> Gary''s Student - gsnu200817
>
>
> "Michelle" wrote:
>
> > Hi!
> > Now that I can delete and recreate a shortcut on the users desktop, can I
> > also delete and create one on their Quick Launch toolbar as well? They have
> > the correct shortcut on their desktop but when they initiate the Quick Launch
> > shortcut they have the wrong shortcut! Thank you so much for your help!
> > By the way I often have trouble posting a question or reply on your form. I
> > comes up blank and I can't post.
> >
> > Function DeleteAndRecreateShortcut()
> >
> > Dim WSHShell As Object
> > Dim MyShortCut As Object
> > Dim DesktopPath As String
> > Dim myFileName As String
> > Dim TestStr As String
> >
> > Set WSHShell = CreateObject("WScript.Shell")
> > DesktopPath = WSHShell.SpecialFolders("Desktop")
> > myFileName = DesktopPath & "\" & "Markup Spreadsheet" & ".lnk"
> >
> > 'Check to see if shortcut exists. If true, delete it.
> >
> > TestStr = ""
> > On Error Resume Next
> > TestStr = Dir(myFileName)
> > On Error GoTo 0
> >
> > If TestStr = "" Then
> > 'doesn't exist
> > Else
> > 'won't hurt if it's not read only, either.
> > SetAttr pathname:=myFileName, Attributes:=vbNormal
> > Kill pathname:=myFileName
> > End If
> >
> > 'Create new shortcut for users desktop
> >
> > Set MyShortCut = WSHShell.CreateShortcut(myFileName)
> > With MyShortCut
> > .TargetPath = _
> > "\\Bwes.net\Barberton file
> > shares\DocControlPLM\BatchLoadFiles\ScriptsAndZips\Shortcuts\Markup
> > Spreadsheet.lnk"
> > .Description = "Markup Spreadsheet"
> > .Save
> > End With
> >
> >
> > Set WSHShell = Nothing
> > MsgBox "The MARKUP SPREADSHEET shortcut has been placed on your desktop"
> > & vbCrLf & _
> > "The shortcut has the same properties as the old shortcut:" &
> > vbCrLf & _
> > " - the shortcut is identified by a Gold Star" & vbCrLf & _
> > " - the shortcut title reads 'Markup Spreadsheet'" & vbCrLf &
> > vbCrLf & _
> > " On OK, this worksheet will close" & vbCrLf & _
> > " Then relaunch the MARKUP spreadsheet from the Desktop shortcut"
> > Workbooks("Document Control Markup.xls").Close SaveChanges:=False
> >
> > End Function
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick Launch Shortcut Order =?Utf-8?B?Q3J5c3RhbCBHdXk=?= Microsoft Windows 2000 Registry 0 24th Sep 2004 11:01 PM
I delete Shortcut in Quick Launch ANSWER Microsoft Windows 2000 Setup 1 22nd Jul 2004 08:13 AM
Quick Launch Desktop Shortcut =?Utf-8?B?QmlnQWw3Mzc=?= Windows XP Basics 1 15th Jul 2004 08:46 AM
Quick Launch Shortcut Sean Fullerton Microsoft Dot NET Framework Forms 1 13th Nov 2003 07:28 PM
Can't add shortcut to Quick Launch...? doug Microsoft Windows 2000 2 8th Sep 2003 07:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:47 AM.