ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   special folders: references for Shell Controls (https://www.excelbanter.com/excel-programming/382189-special-folders-references-shell-controls.html)

Allen_N

special folders: references for Shell Controls
 
I tried to implement the example in
'http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_higv.mspx?mfr=true
to get the 'My Documents' and 'Desktop' folders, but Excel doesn't like the
'.Self' property of the 'Folder' object.

The references to add were given in
'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/objectmap.asp' as:

Microsoft Internet Controls (SHDocVw)
Microsoft Shell Controls and Automation (Shell32)

but the 1st one isn't listed in the available references in my Excel 2003,
and adding the 2nd reference didn't fix my problem.

Does anyone know what these references should be for Windows XP?

Bob Phillips

special folders: references for Shell Controls
 
Const wsh_SPECIAL_FOLDER_DESKTOP = 10
Const wsh_SPECIAL_FOLDER_MY_DOCS As Long = 16
Dim oWSH As Object

Set oWSH = CreateObject("WScript.Shell")

MsgBox oWSH.SpecialFolders(wsh_SPECIAL_FOLDER_DESKTOP)

MsgBox oWSH.SpecialFolders(wsh_SPECIAL_FOLDER_MY_DOCS)


--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Allen_N" wrote in message
...
I tried to implement the example in

'http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_higv.mspx?mfr=t
rue
to get the 'My Documents' and 'Desktop' folders, but Excel doesn't like

the
'.Self' property of the 'Folder' object.

The references to add were given in

'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pl
atform/shell/programmersguide/shell_basics/shell_basics_programming/objectma
p.asp' as:

Microsoft Internet Controls (SHDocVw)
Microsoft Shell Controls and Automation (Shell32)

but the 1st one isn't listed in the available references in my Excel 2003,
and adding the 2nd reference didn't fix my problem.

Does anyone know what these references should be for Windows XP?




Ron de Bruin

special folders: references for Shell Controls
 
Maybe this will help

Sub GetSpecialFolder()
'Special folders are : AllUsersDesktop, AllUsersStartMenu
'AllUsersPrograms, AllUsersStartup, Desktop, Favorites
'Fonts, MyDocuments, NetHood, PrintHood, Programs, Recent
'SendTo, StartMenu, Startup, Templates

'Get Favorites folder and open it
Dim WshShell As Object
Dim SpecialPath As String

Set WshShell = CreateObject("WScript.Shell")
SpecialPath = WshShell.SpecialFolders("Favorites")
MsgBox SpecialPath
'Open folder in Explorer
Shell "explorer.exe " & SpecialPath, vbNormalFocus
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Allen_N" wrote in message ...
I tried to implement the example in
'http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_higv.mspx?mfr=true
to get the 'My Documents' and 'Desktop' folders, but Excel doesn't like the
'.Self' property of the 'Folder' object.

The references to add were given in
'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/objectmap.asp'
as:

Microsoft Internet Controls (SHDocVw)
Microsoft Shell Controls and Automation (Shell32)

but the 1st one isn't listed in the available references in my Excel 2003,
and adding the 2nd reference didn't fix my problem.

Does anyone know what these references should be for Windows XP?




All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com