Solved

Access 2003 clipboard hyperlink problem

Posted on 2013-11-26
3
230 Views
Last Modified: 2013-11-28
I have a form that takes name/address/plus info copied to the clipboard from the internet. It then parses it into an Access table.

I have a problem when one of the lines copied is a hyperlink.  When there is a hyperlink it gets included with the previous line (no carriage return on the previous line).

Example of lines on internet copied:

Your Source For Local Real Estate
http://www.MyRealtor.com/

When pasted onto the form they appear as:

Your Source For Local Real Estatehttp://www.MyRealtor.com/

My copy function:

Function GetClipBoardText()
   Dim DataObj As MSForms.DataObject
   Set DataObj = New MSForms.DataObject
   On Error GoTo cberr
    'Get data from the clipboard.
   DataObj.GetFromClipboard
   [ipAddrInfo].SetFocus
   'Get clipboard contents
   [ipAddrInfo] = DataObj.GetText(1)
   Exit Function
cberr:
   If Err <> 0 Then MsgBox "Data on clipboard is not text or is empty"
End Function
0
Comment
Question by:WFBweb
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
jaynee earned 180 total points
ID: 39684626
Not sure why its happening, but you could parse for the start of the hyperlink, and if you find "http:/" then just add a chr(10) to the start of it.
0
 
LVL 7

Expert Comment

by:jaynee
ID: 39684633
eg

[ipAddrInfo] = StrTranOnce(DataObj.GetText(1), "http:/", chr(10)&"http:/")

where

Public Function StrTranOnce(Instring As String, FindChar As String, ReplaceChar As String) As String
  Dim tmpString As String, CharPosition As Integer
  StrTranOnce = Instring
  If FindChar = ReplaceChar Or Trim(Instring) = "" Then Exit Function
  CharPosition = InStr(1, Instring, FindChar, 1)
  tmpString = Left(Instring, CharPosition - 1)
  tmpString = tmpString + ReplaceChar
  StrTranOnce = tmpString + Mid(Instring, CharPosition + Len(FindChar))
End Function
0
 

Author Closing Comment

by:WFBweb
ID: 39684659
thanks.....that does the trick!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Outlook Free & Paid Tools
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now