#8174
Support 3
Participant

Thanks for the explanation.

May be you can use the account email address which is unique. The code below uses the email address, it will remove any invalid characters (i.e. ?, :, etc) from the email address.

  
Sub Main(Client, GWEvent)

  dim oAccount

  Set oAccount = client.clientstate.currentaccount
  msgbox ReplaceInvalidFileName(oAccount.owner.emailaddress)
  set oAccount = nothing

End Sub



' Replace invalid characters from file name
function ReplaceInvalidFileName(aFileName)

  Set oRegExp = New RegExp
  oRegExp.Global = True
  oRegExp.IgnoreCase = True
  oRegExp.Pattern = "[t""*/:;<>?\|]"

  ReplaceInvalidFileName = oRegExp.Replace(aFileName, "_")

  set oRegExp = nothing

end function

Hope this helps.

Regards,
Advansys Support