In v17, the Document type command has become depreciated and in its place has been succeeded by the new command Path to object command.
Both commands behave similarly with the major difference being the results returned. Document type simpily returned the extension or type of document for a pathname passed.
The Path to object command returns an object that contains more information about the path passed including the extention as one of the properties.
$resultObject:=Path to object("C:\\Users\user\\Desktop\\MyText.txt")
To directly obtain the extension in this case the property can be accessed with $resultObject.extension
Both the commands do not confirm that the path is valid or exists. This can be confirmed with the Test path name command.