|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problem with generating file shortcut in VBversion of some code I found on the net that is supposed to do the job The compiler complains about "WshShell" in the 5th line below. It says "Reference to a non-shared member requires an object reference". I'm not sure what it's trying to tell me here. thanks for any help I'm using Visual Studio 2003. To get the IWshRuntimeLibrary, from the menu bar: project/add references/com/Windows Script Host Object Model Imports IWshRuntimeLibrary Module Module3 Sub zzz() Dim shortCut As IWshRuntimeLibrary.IWshShortcut shortCut = CType(WshShell.CreateShortcut("C:\AAQQ.lnk"), _ IWshRuntimeLibrary.IWshShortcut) End Sub Hello Mike,
shortCut = CType((New IWshRuntimeLibrary.WshShell).CreateShortcut("C:\AAQQ.lnk"), IWshRuntimeLibrary.IWshShortcut) Regards. Show quoteHide quote "Mike" <mikea***@hotmail.com> escribió en el mensaje news:124koocfs0as7a0@corp.supernews.com... | I'm trying to generate a shortcut file from VB. The code below is a cutdown | version of some code I found on the net that is supposed to do the job | | The compiler complains about "WshShell" in the 5th line below. It says | "Reference to a non-shared member requires an object reference". I'm not | sure what it's trying to tell me here. | | thanks for any help | | I'm using Visual Studio 2003. To get the IWshRuntimeLibrary, from the menu | bar: project/add references/com/Windows Script Host Object Model | | | | Imports IWshRuntimeLibrary | | Module Module3 | | Sub zzz() | | Dim shortCut As IWshRuntimeLibrary.IWshShortcut | | shortCut = CType(WshShell.CreateShortcut("C:\AAQQ.lnk"), _ | | IWshRuntimeLibrary.IWshShortcut) | | End Sub Thanks Jose, that did the trick.
Mike "José Manuel Agüero" <chema012 en hotmail.com> wrote in message shortCut = CType((New news:ekYb7nsZGHA.4580@TK2MSFTNGP03.phx.gbl... Hello Mike, IWshRuntimeLibrary.WshShell).CreateShortcut("C:\AAQQ.lnk"), IWshRuntimeLibrary.IWshShortcut) Regards. Show quoteHide quote "Mike" <mikea***@hotmail.com> escribió en el mensaje news:124koocfs0as7a0@corp.supernews.com... | I'm trying to generate a shortcut file from VB. The code below is a cutdown | version of some code I found on the net that is supposed to do the job | | The compiler complains about "WshShell" in the 5th line below. It says | "Reference to a non-shared member requires an object reference". I'm not | sure what it's trying to tell me here. | | thanks for any help | | I'm using Visual Studio 2003. To get the IWshRuntimeLibrary, from the menu | bar: project/add references/com/Windows Script Host Object Model | | | | Imports IWshRuntimeLibrary | | Module Module3 | | Sub zzz() | | Dim shortCut As IWshRuntimeLibrary.IWshShortcut | | shortCut = CType(WshShell.CreateShortcut("C:\AAQQ.lnk"), _ | | IWshRuntimeLibrary.IWshShortcut) | | End Sub
Web Browser in Windows App
RS232 - Recive = Send???? Debug.Wrile does not appear on the Output Window Unused variables that really are?!? Trying to execute something stored in variable GetCurrentProcess.Id vs GetCurrentProcessId API Can't delete an image that is in a picture box Form Visibility Issue VB.NET 2003 Paste logo on image Close a msgbox |
|||||||||||||||||||||||