Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 10-10-2012, 12:08 PM
ximpostor ximpostor is offline Windows 7 64bit Office 2003
Novice
 
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 Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,033
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

You probably should be using:
TaskID = Shell("C:\Users\" & Environ("UserName") & "\Documents", vbNormalFocus)
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 10-12-2012, 12:38 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,033
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
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
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
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
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


All times are GMT -7. The time now is 09:58 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft