PDA

View Full Version : FileLen() crashes with Unicode file names



Vectopelis
03-13-2008, 05:41 AM
When I try to use function FileLen() passing file name with Unicode characters, it crashes saying that file does not exist. With non Unicode file names i have no problems. But using non-Unicode filenames is not an option for me. Can You please help me?

Trevor
03-14-2008, 12:55 PM
did you use quotes
If len(dir("c:\temp", vbdirectory)) = 0 then
[condition]
or

If len("c:\temp") = 0 then
[condition]

Vectopelis
03-17-2008, 12:32 AM
Actually problems looks like this

Sub test()
Dim doc As Document 'current dopcument
Set doc = Documents.Application.ActiveDocument
MsgBox FileLen(doc.FullName)
End Sub

So when you have unicode characters in your document name, fileLen function does not seem to work.