Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / General MS Word Questions / December 2003

Tip: Looking for answers? Try searching our database.

Checking if a folder exists

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
liddlem - 30 Dec 2003 05:35 GMT
Hi Folks
Can anybody please explain to me how to check whether a folder alread
exists.

I have searched the M.S help file and all it shows, is the syntax as
object.FolderExists(folderspec)
but no example of how to actually use it.

What do I substitute in the place of 'object' here?
Am I correct to assume that the code should read something like

If WhatEverTheObjectIs.FolderExists(MyPathName) then
Do Something here
End If

Thanks for your assistance
Cindy M  -WordMVP- - 30 Dec 2003 08:06 GMT
Hi Liddlem,

You should address this question to a word.vba newsgroup. This group is
frequented more by end-users and less by those with the programming
knowledge you seek. Please include the VERSION of Word, Windows and IE
in your message.

Based on what you say in this message, I'd say look in the Word VBA Help
for the information on DIR.

Another possibility would be the FileSystemObject, which has much more
extensive file/folder functionality. This is part of the Microsoft
Scripting Runtime, which may not be installed on an older system. You'd
need to activate a Reference to this library in order to access its help
files. Try a Google search on FileSystemObject in the word.vba
newsgroups for some examples.

> Can anybody please explain to me how to check whether a folder already
> exists.
>  
> I have searched the M.S help file and all it shows, is the syntax as
> object.FolderExists(folderspec)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
liddlem - 31 Dec 2003 09:09 GMT
Thanks Cindy
I found the solution as you suggested - (by searching in google)

And thanks too for the tip on using Word.VBA newsgroups
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.