Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access 2003 clipboard hyperlink problem

Posted on 2013-11-26
3
Medium Priority
?
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
jaynee earned 720 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
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: …

722 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