Results 1 to 6 of 6

Thread: Pasted Text

  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi All,
    In my DB front end, the user can paste in notes from various places. Is there some code that will turn it into pure text before stamping it into the table? Sometimes on paste operations, the record will get corrupted. The problem comes from the fact that sometimes there are some weird ASCII characters and the table does not like it. If I could run something on the string prior to entering it into the record, that would be great.

    Thanks,
    Mark

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Do you have any idea which characters cause problems? If so, you could strip them away in the After Update event of the control using the Replace function, e.g.

    Code:
    Private Sub txtData_AfterUpdate()
      Me.txtData = Replace(Me.txtData, vbTab, " ")
      Me.txtData = Replace(Me.txtData, vbCrLf, "")
    End Sub

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Hans,
    No idea at this point. It is hard enough to try to isolate the corrupt record after the text is pasted in and I wouldn't have any clue how to find out as we usually just delete the faulty record. I can say for sure that 99.9% of the problems come as users paste in text from Outlook.

    My ultimate integration would be to have one mailbox monitored in outlook. This would be for the purposes of support notes that customers send back. I could pull mail text in or "Link" messages to records. Do you know if anyone has done such a thing?

    Thanks,
    Mark



    [quote name='HansV' post='783236' date='06-Jul-2009 12:41']Do you have any idea which characters cause problems? If so, you could strip them away in the After Update event of the control using the Replace function, e.g.

    Code:
    Private Sub txtData_AfterUpdate()
      Me.txtData = Replace(Me.txtData, vbTab, " ")
      Me.txtData = Replace(Me.txtData, vbCrLf, "")
    End Sub
    [/quote]

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can use Automation to control Outlook from Access using VBA - you could read messages in a mail folder, extract and process the subject and/or body of the messages, then move them to another folder.
    This is not extremely difficult, but it requires that you are reasonably familiar with both Access VBA and Outlook VBA.

    See WendellB’s tutorial Automation 101 for an introduction and useful links, and search this forum for Outlook.Application to see examples.

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Hans,
    Since this is something we do quite a bit with the DB and it is inefficient in it's current state, I think I will dive in....

    Thanks,
    Mark


    [quote name='HansV' post='783246' date='06-Jul-2009 15:18']You can use Automation to control Outlook from Access using VBA - you could read messages in a mail folder, extract and process the subject and/or body of the messages, then move them to another folder.
    This is not extremely difficult, but it requires that you are reasonably familiar with both Access VBA and Outlook VBA.

    See WendellB’s tutorial Automation 101 for an introduction and useful links, and search this forum for Outlook.Application to see examples.[/quote]

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Don't hesitate to ask questions if you need help with details of your application.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •