Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Other Microsoft Products _ Microsoft Documentation Less Than Helpful

Posted by: jabm May 22 2020, 05:15 PM

To make a long story short I've been looking up ways to code an Access text box for file path accessibility (store full file path, open file on double click)
Anyway I am looking at their documentation on the MsoFileDialogType which makes some sense (doesn't fully explain the differences/uses of the 4 types - https://docs.microsoft.com/en-us/office/vba/api/office.msofiledialogtype)
and I scroll down the left-sided menu and see MsoPathFormat (https://docs.microsoft.com/en-us/office/vba/api/office.msopathformat) -- all the explanation say is this is for path type 1, path type 2, etc. What exactly are these different path types? I know I don't really *need* to know this for what I am trying but now that I've stumbled upon it I am more puzzled than not. For the most part, the docs.microsoft.com are sorely lacking in explanations and it is frustrating to beginners

Thank you

Posted by: FrankRuperto May 22 2020, 05:27 PM

The link you provided does not exist. Try this one: https://docs.microsoft.com/en-us/office/vba/api/office.msofiledialogtype

QUOTE (jabm)
...ways to code an Access text box for file path accessibility (store full file path, open file on double click)


Put a control next to the file path text box. Clicking the control can then open the file.


Posted by: jabm May 22 2020, 05:42 PM

It was just that the ending ')' for my sentence fragment was being picked up as part of the URL - fixed
And yes I will most likely adding a button -
But this still doesn't answer the question of what exactly is path "Type1", "Type2", etc.


Posted by: theDBguy May 22 2020, 05:44 PM

Hi. If you're looking for a way to open the file browser to select a file and store its path, then check out the https://docs.microsoft.com/en-us/office/vba/api/office.filedialog, which uses the FileDialogType. You would want to use msoFileDialogFilePicker.

Posted by: jabm May 22 2020, 05:57 PM

Thanks - am looking at that documentation -- and trying to understand the different MsoFileDialogTypes which are used by the FileDialog object.
There are 2 parts of what I am trying to do (which I'll most likely be posting questions on later in the Forms Forum)
1) To be able to fill the text box initially with the document file path (just let it be a straight let them type it or code either in the textbox control itself or from a button along side).
2) Once the textbox control has the data of the document file path how to have the user open the file.

I still trying to learn and understand the overall surroundings/Microsoft Access - which is the purpose of this specific topic thread - what is meant by the different file path formats
All this says ( https://docs.microsoft.com/en-us/office/vba/api/office.msopathformat ) is that
msoPathType1 has a value of 1 and represents the Type1 format
msoPathType2 has a value of 2 and represents the Type2 format
etc.

-- but what *exactly* is the Type1 format and how does it differ from the Type2 format, or the Type3 format?

I know I don't need to know this for my project, but now that I've seen it, I would like to understand for the sake of understanding...

Posted by: FrankRuperto May 22 2020, 06:41 PM

Hi jabm,

I thought your objective was to open the file whose absolute path is stored in the text field?... If it's the file browser you want for picking any file, then use what DBGuy suggested.

You don't need to be concerned with the enumerations of https://docs.microsoft.com/en-us/office/vba/api/office.msopathformat.

There are two types of paths, absolute and relative: https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats

All you have to do is create the appropiate DialogObject, like in the example DBGuy provided for the picker.

CODE
Set fd = Application.FileDialog(msoFileDialogFilePicker)

Posted by: jabm May 22 2020, 06:48 PM

Not on this particular thread -- re-read the initial post - I am just trying to understand - in this particular thread - is: what is meant by Type1, Type2, Type3, etc that the msoPathType1, msoPathType2, msoPathType3, etc represent.
The part of the initial thread relating to the opening of a file was just to explain how I got to the MS Documentation in question.

Thank you

Posted by: FrankRuperto May 22 2020, 07:15 PM

See my edited post #6

Posted by: jabm May 22 2020, 07:49 PM

Yes it is true I don't need to concern with them, but the knowledge for the sake of knowledge is good too.

The point is that the official MS Documentation is less than helpful and since they have bothered to have msoPathType1, msoPathType2 and have at least the page for the non-documentation, then there should be information as to what the Type1, Type2, Type3, etc. actually are.

That is all I am looking for here to know what the Type1 that the msoPathType1 represents is.

Their documentation saying that it represents Type#, without even a link explaining what the Type# are makes the page pointless.

I'm not trying to be argumentative, just want to know for the sake of knowing and understanding.


Posted by: FrankRuperto May 22 2020, 09:02 PM

Agreed, the docs don't really explain in more detail what they mean. My common sense guesses each type refers to the different subtypes of absolute and relative paths. These enums are real low-level stuff used in Office Win32 TypeLib's for mso.dll

They're constants included in the mso_enum.h header file used in Microsoft's cpp source code. I wouldn't bother trying to figure it out or store it in your brain. There's plenty of other Access/VBA idiosyncrasy to learn and remmeber lol.

Posted by: jabm May 22 2020, 09:07 PM

Thanks!



Posted by: tina t May 23 2020, 01:24 AM

hello Julia, take a look at https://docs.microsoft.com/en-us/office/vba/api/access.application.filedialog, which page also contains https://docs.microsoft.com/en-us/office/vba/api/office.msofiledialogtype. those may help a little bit.

also, i worked with Application.FileDialog some last year, when i was rewriting code in one of my dbs (converting from A97 to A2016, fun times). i did some testing, and made some notes. hmm, they may be kinda lame, but i'll try to remember to post them when i go back to work after the holiday. i just hope folks here will be kind and not laugh too hard! ;)

hth
tina

Posted by: jabm May 23 2020, 08:44 AM

Thank you Tina!