PC Review


Reply
Thread Tools Rate Thread

Creating Folder Folder in My Documents VBA - HELP

 
 
Ali
Guest
Posts: n/a
 
      25th Jul 2005
Hi,

I am trying to find out how to create a folder in the My Documents folder.

I tried looking for system variables that could lead me to the location of
the my Documents folder, so that I coudl use mkdir and the path, but the
problem is, the my document is mapped to the server, and not to the
C:\documents and settings subfolders.

Will appreciate if i could get some help on this.

I will eventually want to create folders within the new folder in the My
Documents.

Thank you!

Ali


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGF0cmljayBNb2xsb3k=?=
Guest
Posts: n/a
 
      25th Jul 2005
I',m not sure ...you could record a macro & record the path that way.
"usuall" the desktop comes under the users path
C:\Documents and Settings\username
however, as with my organisation, teh users desktop is saved on a network,
privately accessible only bu th euser, so that th euser can log-on from any
station and have access to the correct applications.




Sub vars()
Dim index As Long
index = 1
On Error Resume Next
Do
Cells(index + 1, 1) = index
Cells(index + 1, 2) = Environ$(index)
index = index + 1
Loop Until Err.Number <> 0
End Sub




"Ali" wrote:

> Hi,
>
> I am trying to find out how to create a folder in the My Documents folder.
>
> I tried looking for system variables that could lead me to the location of
> the my Documents folder, so that I coudl use mkdir and the path, but the
> problem is, the my document is mapped to the server, and not to the
> C:\documents and settings subfolders.
>
> Will appreciate if i could get some help on this.
>
> I will eventually want to create folders within the new folder in the My
> Documents.
>
> Thank you!
>
> Ali
>
>
>

 
Reply With Quote
 
 
 
 
moi
Guest
Posts: n/a
 
      25th Jul 2005
Use WSHost for getting the full MyDocuments path, change to that dir and
create a new folder.

Public Sub addMyDocumentsDir()
Dim wShell, fso, strFldr As String
Set wShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
strFldr = wShell.SpecialFolders("MyDocuments")
ChDir (strFldr)
fso.CreateFolder ("test123")
End Sub



"Ali" <(E-Mail Removed)> schreef in bericht
news:u8$(E-Mail Removed)...
> Hi,
>
> I am trying to find out how to create a folder in the My Documents folder.
>
> I tried looking for system variables that could lead me to the location of
> the my Documents folder, so that I coudl use mkdir and the path, but the
> problem is, the my document is mapped to the server, and not to the
> C:\documents and settings subfolders.
>
> Will appreciate if i could get some help on this.
>
> I will eventually want to create folders within the new folder in the My
> Documents.
>
> Thank you!
>
> Ali
>



 
Reply With Quote
 
=?Utf-8?B?VGo=?=
Guest
Posts: n/a
 
      25th Jul 2005
Thank you!! This worked great!

"moi" wrote:

> Use WSHost for getting the full MyDocuments path, change to that dir and
> create a new folder.
>
> Public Sub addMyDocumentsDir()
> Dim wShell, fso, strFldr As String
> Set wShell = CreateObject("WScript.Shell")
> Set fso = CreateObject("Scripting.FileSystemObject")
> strFldr = wShell.SpecialFolders("MyDocuments")
> ChDir (strFldr)
> fso.CreateFolder ("test123")
> End Sub
>
>
>
> "Ali" <(E-Mail Removed)> schreef in bericht
> news:u8$(E-Mail Removed)...
> > Hi,
> >
> > I am trying to find out how to create a folder in the My Documents folder.
> >
> > I tried looking for system variables that could lead me to the location of
> > the my Documents folder, so that I coudl use mkdir and the path, but the
> > problem is, the my document is mapped to the server, and not to the
> > C:\documents and settings subfolders.
> >
> > Will appreciate if i could get some help on this.
> >
> > I will eventually want to create folders within the new folder in the My
> > Documents.
> >
> > Thank you!
> >
> > Ali
> >

>
>
>

 
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
Creating VBA Functions When Creating Spreadsheet Via VBA? PeteCresswell Microsoft Excel Programming 6 18th Jun 2007 12:38 PM
HELP NEEDED FAST!!! HELP HELP HELP HELP HELP HELP FAST HELP NEEDED Jonathan Windows XP General 10 13th Jan 2005 03:22 AM
"Shared Documents" folder being displayed "Documents" Farnk Windows XP Help 2 9th Feb 2004 09:11 PM
Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! -$- Windows XP Internet Explorer 2 21st Dec 2003 11:45 PM
Access to Documents, (n All Users folder in Documents and Settings) is denied Anup Bogineni Windows XP Security 0 23rd Sep 2003 08:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:04 PM.