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
Prevent an Application from creating a folder in My Documents George Valkov Windows Vista General Discussion 5 22nd Mar 2012 07:18 AM
creating unwanted Documents folder in word 2007 robbo66 Microsoft Word Document Management 0 19th Feb 2008 01:06 PM
code for creating a new folder in current user's My Documents? gils usenet acct Microsoft Word Document Management 2 9th Oct 2005 05:15 PM
Rename my account folder that appears under the Documents and Settings folder? Peter Sale Windows XP General 0 18th Dec 2003 06:25 AM
Creating a button to open a specific folder in my documents rob nobel Microsoft Excel Misc 2 18th Oct 2003 07:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:47 PM.