mso code???? (1 Viewer)

Robert88

Robbie
Local time
Today, 10:34
Joined
Dec 18, 2004
Messages
335
mso commands???

Hi All,

Recently I asked about finding information from folders or in my case a CD.

http://www.access-programmers.co.uk/forums/showthread.php?p=415218#post415218

Thanks to GHudson I managed to download the file attached in his comments, which I noticed has lost it link but that is another story.

I want to know more about the mso commands in this example as I cannot seem to find it in any books as shown red below.

Can anyone suggest a book on it as having problems searching books on amazon within indexes to find code like it. Rather than ask a lot of question about it I would rather read a good book on it, then ask questions.

I hope someone can help?

An example of the code is:

Code:
Private Sub CmdSearchMyDocuments_Click()

    Set fs = Application.FileSearch
    With fs
        .LookIn = "C:\CD Data"
        .FileName = "*.*"
        .SearchSubFolders = True
        If .Execute(SortBy:=[COLOR="Red"]msoSortbyFileName[/COLOR], _
                SortOrder:=[COLOR="red"]msoSortOrderAscending[/COLOR]) > 0 Then
            MsgBox "There were " & .FoundFiles.Count & _
                " file(s) found."
            For I = 1 To .FoundFiles.Count
                MsgBox .FoundFiles(I)
            Next I
        Else
            MsgBox "There were no files found."
        End If
    End With

End Sub
 

Attachments

  • Browsing2.zip
    73.6 KB · Views: 86
Last edited:

Mile-O

Back once again...
Local time
Today, 01:34
Joined
Dec 10, 2002
Messages
11,316
mso is just a prefix. It doesn't mean anything other than an indication of the variable/constant/object it's referring to.

That code looks as though Ghudson has added a reference to Microsoft Office Objects Library and used that to search your CD.
 

Robert88

Robbie
Local time
Today, 10:34
Joined
Dec 18, 2004
Messages
335
Hi Gents,

Thanks for your reply's.

Is this one of Microsoft's secrets, still cannot find a book with it and noticed that not many people have rated the site. I suppose for the small amount of information that is there, thank you!!!! Better than nothing.

Robert88.
 

Sergeant

Someone's gotta do it
Local time
, 20:34
Joined
Jan 4, 2003
Messages
638
SJ McAbney said:
mso is just a prefix. It doesn't mean anything other than an indication of the variable/constant/object it's referring to.

That code looks as though Ghudson has added a reference to Microsoft Office Objects Library and used that to search your CD.
I really have to differ with you.
There is a long list of documented msoX constants on MSDN. It is not just a handy prefix that GHudson added.
 

ghudson

Registered User.
Local time
, 20:34
Joined
Jun 8, 2002
Messages
6,194
SJ McAbney said:
mso is just a prefix. It doesn't mean anything other than an indication of the variable/constant/object it's referring to.

That code looks as though Ghudson has added a reference to Microsoft Office Objects Library and used that to search your CD.
The msoFileTypeAllFiles constant is taken straight from the sample code by Microsoft. Here is a link to using the FileSearch Object to search a directory. I have posted that code if a few other threads like this one Access 97 and Windows XP but I am not using it in my Browse [Find a directory or file] sample.
 

Robert88

Robbie
Local time
Today, 10:34
Joined
Dec 18, 2004
Messages
335
Hi All,

Thank you everybody's comments.

Sorry, GHudson. You might be right about it not being used in your browsing2.zip as I might of added it. Sorry about that.

As mentioned in the link at the top from my original posting, all I want to do now that I am able to get the content of the CD, path and filename to a message box, is place all this information in a table. Hence the reason for wanting to know more about the mso commands. I suppose it is a need to know where it has come from in order to work-out where to go to.

If anybody can give me this solution it would be a treat as I have seen many people ask the question in other posts but have not seen a solution, even if the solution is close which I can modify to my needs.

If nobody helps with this I am still working on it, I am learning and it is great.:) I am assuming I need to do a little more reading on adding recordsets to a table. Just want to place the folderpath in one field and filename in another.

Robert88
 
Last edited:

Users who are viewing this thread

Top Bottom