Pasting text

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

Guest

When hyperlink fields are updated they have to be in the format
c:\Folder\File.doc#c:\folder\file.doc

Currently I have c:\folder\file.doc in a hyperlink field which I can copy to
the clipboard with the following code:

txtHyperField.SetFocus
RunCommand acCmdCopy

How can I paste this such that c:\Folder\File.doc#c:\folder\file.doc.

I am looking for something along the lines of:
txtHyperField.SetFocus
RunCommand acCmdPaste + "#" + acCmdPaste

Thanks for your help!
 
Actually, you need a trailing # as well.

To create a variable from the contents of the clipboard sounds fraught with
issues, but the API calls to manipulate the clipboard are in this link:
http://www.mvps.org/access/api/api0049.htm

If you already have the value in a hyperlink field, you could parse it with
HyperlinkPart().

If you already have the text somewhere (text1 in this example), you could
assign it to the hyperlink field with:
Me.txtHyperlinkField = Me.text1 & "#" & Me.text1 & "#"
 
Back
Top