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 / Outlook / Programming Forms / January 2005

Tip: Looking for answers? Try searching our database.

"Dir" statement in VBScript ...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vaughan - 28 Jan 2005 15:55 GMT
... does it work? I'm getting an error (type mismatch) and don'ty know if
I've used it incorrectly or if it simply doesn't work in VBS.
Sue Mosher [MVP-Outlook] - 28 Jan 2005 17:03 GMT
How would anyone be able to tell without seeing your code?

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> ... does it work? I'm getting an error (type mismatch) and don'ty know if
> I've used it incorrectly or if it simply doesn't work in VBS.
Wolfram Jahn - 28 Jan 2005 18:49 GMT
> How would anyone be able to tell without seeing your code?

Easy, Sue.
There is no 'dir' function in VBSCRIPT.

See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/v
torifunctions.asp


:-)

Wolfram
Sue Mosher [MVP-Outlook] - 28 Jan 2005 19:42 GMT
My point is that if the original poster shows their code and thereby what
they're trying to accomplish, it should be possible to steer them in the
right direction.

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

>> How would anyone be able to tell without seeing your code?
>>
[quoted text clipped - 7 lines]
>
> Wolfram
Vaughan - 29 Jan 2005 09:45 GMT
Sue, I can definitely see where you're coming from with this. That's why I
originally wrote my question like this:

> I have a custom form with a combo-box control. The Combo-box is populated
> with data from an Access database using DAO. It works fine, but there's one
[quoted text clipped - 16 lines]
>
> Vaughan

But that didn't excite anyone enough to get a response. Having posted about
20 or so questions to this group over six months, I have found that when I
give a full explanation of what I'm trying to do nobody answers. If I then
boil the question down to a couple of lines, I usually get exactly what I
need (more often than not from you Sue. And believe me, I couldn't be more
grateful for all your help.)

In this case, the ploy only worked up to a point. Wolfram has answered my
specific question (thanks Wolfie) but, as you spotted, that doesn't resolve
my overall problem of how to test whether the path to my database is valid
when I run the form. If you (or anyone) can give me a solution to that, I
would be most extremely grateful.

Thanks again for your interest and help

Vaughan

> My point is that if the original poster shows their code and thereby what
> they're trying to accomplish, it should be possible to steer them in the
[quoted text clipped - 11 lines]
> >
> > Wolfram
Wolfram Jahn - 29 Jan 2005 20:02 GMT
Hi,

you could have added one short question to your OP, e.g.

> ... does it work? I'm getting an error (type mismatch)
> and don'ty know if I've used it incorrectly or if it
> simply doesn't work in VBS.
+++
> Any other chance to get file/dir information?
---

Short and clear.

If you ask if dir does/doesn't work then the answer that dir doesn't
exist is exact. I do not want to guess your questions.

Now that you asked, did you consider to use scripting?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/s
gprogrammingfilesystemobject.asp


found there:

Function ReportFileStatus(filespec)
   Dim fso, msg
   Set fso = CreateObject("Scripting.FileSystemObject")
   If (fso.FileExists(filespec)) Then
      msg = filespec & " exists."
   Else
      msg = filespec & " doesn't exist."
   End If
   ReportFileStatus = msg
End Function

Kind regards

Wolfram
Vaughan - 30 Jan 2005 07:53 GMT
Hi Wolfram

You are absolutely right, I will make sure my osts are more carefully worded
in the future.

And thanks for our suggestions which seems to do exactly what I wanted. I
just have one question. To make it work on my machine I had to add the
Scriting runtime Library to the list of references in Outlook. Will I need to
do this for everyone who uses the form, or can I get the library to be added
by coding it in the form somehow?

Thanks

Vaughan

> Hi,
>
[quoted text clipped - 32 lines]
>
> Wolfram
Wolfram Jahn - 30 Jan 2005 18:25 GMT
> To make it work on my machine I had to add the
> Scriting runtime Library to the list of references in Outlook.

If you use vbscript code in a custom form you need no reference in Outlook.

> Will I need to
> do this for everyone who uses the form, or can I get the library to be added
> by coding it in the form somehow?

I just checked it - I had not even to open the vba editor, just
customized a form, and the code ran.

If you like, I will send an example .oft file by email.

Wolfram
Vaughan - 31 Jan 2005 14:39 GMT
Thanks Wolfman

I tested the form on some other pcs around here and they all worked fine.
The code I already have works fine too, so you don't need to email the .oft
file.

I think this one is resolved now.

Best regards

Vaughan

> > To make it work on my machine I had to add the
> > Scriting runtime Library to the list of references in Outlook.
[quoted text clipped - 11 lines]
>
> Wolfram
 
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.