Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-10-2012, 12:08 PM
ximpostor ximpostor is offline a problem with the "Documents" folder location in VBA !! Windows 7 64bit a problem with the "Documents" folder location in VBA !! Office 2003
Novice
a problem with the "Documents" folder location in VBA !!
 
Join Date: Oct 2012
Posts: 8
ximpostor is on a distinguished road
Default a problem with the "Documents" folder location in VBA !!


TaskID = Shell("C:\Users\%username%\Documents", vbNormalFocus)

i want to open the Documents folder by macro on any user !!

the problem is here "%username%" !!!
Reply With Quote
  #2  
Old 10-11-2012, 06:08 PM
macropod's Avatar
macropod macropod is offline a problem with the "Documents" folder location in VBA !! Windows 7 64bit a problem with the "Documents" folder location in VBA !! Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You probably should be using:
TaskID = Shell("C:\Users\" & Environ("UserName") & "\Documents", vbNormalFocus)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-12-2012, 12:38 PM
macropod's Avatar
macropod macropod is offline a problem with the "Documents" folder location in VBA !! Windows 7 64bit a problem with the "Documents" folder location in VBA !! Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at: http://www.vbaexpress.com/forum/showthread.php?t=43965
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
a problem with the "Documents" folder location in VBA !! Outlook 2010 "Unread Mail" folder missing Emerogork Outlook 11 03-07-2013 03:32 PM
Import holidays without "location" info SteveRomo Outlook 0 08-10-2012 03:54 PM
a problem with the "Documents" folder location in VBA !! How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM
direct incoming email to "outlook" folder inbox John Ames Outlook 8 06-25-2011 02:51 PM
outlook "Unread Email" folder automaticaly reads then dissapears emails michaelrj9 Office 0 08-20-2010 03:59 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:48 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft