how to encode vcard filenames without umlauts, etc

L

leo

hi there

i wrote a macro to extract all my contacts to vcards. for writing the files
i use:

sName = path & Item.FileAs & ".vcf"
Item.SaveAs sName, olVCard

sName now can contain umlaute, etc, which clash as a filename with some
filessytems, etc.

how can i avoid that? can i encode the FileAs property somehow?

thanks a lot, leo
 
K

Ken Slovak - [MVP - Outlook]

You would have to strip illegal characters from the name in your code. Use
the Replace function for that:
sName = Replace(sName, "~", "")
and so on for any illegal characters that might appear in the name.
 
Top