We have an application in which one component has an agent facilitating the attachment of files to a document without necessarily editing that document.
It’s pretty basic script stuff - I prompt the user to select a file from the file system using “NEMGetFile” as documented elsewhere in the forums…
Declare Function NEMGetFile Lib “nnotesws” ( wUnk As Integer, Byval fileName As String, Byval szFilter As String, Byval szTitle As String ) As Integer
fileName$ = Chr(0)
If NEMGetFile( 0, fileName$, “All Files|.|”, “Select File” ) = 0 Then Exit Sub
I then grab a handle to the document backend and richtext field, attach the file, and save the document…
Set rtitem = thisDoc.GetFirstItem( “Body” )
Call rtitem.EmbedObject( EMBED_ATTACHMENT, “”, fileName$ )
Call thisDoc.Save( True, True )
There’s alot more to it than just that, but that’s the gist of the logic.
In any case, it all works very well, as long as the file names use English characters.
Once we rolled the app into countries such as Japan and Korea, the users started attempting to attach files with names like “C:\QUOTE ¿©ºñ±³ÅëºñÆ÷ÇÔ-SA[R 1.0].doc”.
Once that happened, the process failed miserably. I started receiving errors such as “Error 4225: File not found” in the “EmbedObject” line.
I notice that the characters used to represent the file in script (above) differ greatly from those used to represent the file when I view the file using Explorer.
I really want to make the application resistant to this sort of incompatibility.
Is there anything I can use in my script to get around this?
Any information you may be able to provide would be most appreciated!
Cheers,
T.