Closed thacht closed 6 months ago
Hi @thacht ,
Thanks for the feedback!
I can confirm that ThisDocument.Path
in Word encodes spaces to %20
. I haven't noticed this as I am mainly an Excel user and there is indeed no problem in Excel.
All I had to do was to add extra logic for decoding such encoded URLs. Please let me know if it works fine for you! Thanks!
I actually pushed a new commit and removed the implicit URL decoding. There could be folders or files that have something like %20
in the name but that does not mean it's an encoded space. it could legitimely be correct name.
Please use GetLocalPath(DecodeURL(ActiveDocument.Path))
. This is cleaner than decoding implicitly and causing issues elsewhere. Thanks!
Thank you for the speedy fix!
I have a Word document in OneDrive where the folder name includes a space. Word VBA .Path returns the http path where the space is replaced by %20 such as:
and GetLocalPath(activedocument.path) returns empty.
Word VBA .FullName returns the http path including the space and GetLocalPath returns the local drive path. Excel VBA .Path returns the http path including the space and GetLocalPath returns the local drive path.