comma forces new value in list box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've created a list box that captures directory paths for attachments to an
emails. It works well with the Common Dialog Control, EXCEPT when the file
path contains a comma. In those cases everything after the comma is inserted
into the next value in the list box. How can I tell the the list box to
include the comma as part of the path. Here is my code, and any help would
be greatly appreciated.--Thanks Frank

Private Sub CmdAttachFile_Click()

List1.AddItem (Text1)

End Sub
 
fgibbcollins said:
I've created a list box that captures directory paths for attachments
to an emails. It works well with the Common Dialog Control, EXCEPT
when the file path contains a comma. In those cases everything after
the comma is inserted into the next value in the list box. How can I
tell the the list box to include the comma as part of the path. Here
is my code, and any help would be greatly appreciated.--Thanks Frank

Private Sub CmdAttachFile_Click()

List1.AddItem (Text1)

End Sub

Try this:

List1.AddItem Chr(34) & Text1 & Chr(34)
 
Dirk! I spoke too soon. It works for the first path but if I attach a second
file path with a comma, all I get is the string after the comma.
 
fgibbcollins said:
Dirk! I spoke too soon. It works for the first path but if I attach
a second file path with a comma, all I get is the string after the
comma.

Works fine for me, repeatedly adding items containing embedded commas,
with that code. Are you sure you're running the same code for the
second attachment as for the first?
 
Dirk, thanks for your time. I'll figure it out. I am sure it's the same
code. I think it has something to do with the code for the dialog control.
I think it's more complex than it needs to be. I'll go find a simpler one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top