Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3667596
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:01:15+00:00 2026-05-19T02:01:15+00:00

In all sorts of programs you can copy hyperlinks to clipboard and paste them

  • 0

In all sorts of programs you can copy hyperlinks to clipboard and paste them into other applications. E g the ’feedback always welcome’ link at the bottom of this page can be copied and pasted into MS Word. I want to create such a link programmatically, copy it to the Clipboard and then be able to paste it somewhere else.

For example a link with the text Stack that maps to stackoverflow.com.

I’ve tried all sorts of things with Clipboard.SetData but nothing seems to do the trick.

(I’m working on a Windows form application in VS2010, .NET4.0)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:01:16+00:00Added an answer on May 19, 2026 at 2:01 am

    I don’t know the architecture you’re working with, but in any case you have just to copy the URL in the Clipboard.

    For example, assuming you’ve got an HyperLink control named myHyperlink and a Button named copyButton.

    When the user clicks the button you have just to use Clipboard.SetText(string) passing to the method the URL Property of myHyperlink.

    EDIT: To show an hyperlink with caption in another program like Word you have to set the text in a HTML way with a particular header.

    Version:0.9
    StartHTML:<<<<<<<1
    EndHTML:<<<<<<<2
    StartFragment:<<<<<<<3
    EndFragment:<<<<<<<4
    SourceURL: www.google.it
    <html>
    <body>
    <!--StartFragment-->
    <a href="http://programmers.stackexchange.com/">programmers</a></span></span>
    <!--EndFragment-->
    </body>
    </html>
    

    This is an example of HTML, let’s try to generalize it in C#:

    private const string html = @"Version:0.9
    StartHTML:<<<<<<<1
    EndHTML:<<<<<<<2
    StartFragment:<<<<<<<3
    EndFragment:<<<<<<<4
    SourceURL: {0}
    <html>
    <body>
    <!--StartFragment-->
    <a href='{0}'>{1}</a>
    <!--EndFragment-->
    </body>
    </html>";
    

    And then use it as follows:

    string link = String.Format(html, "http://www.google.it", "Google");
    Clipboard.SetText(link, TextDataFormat.Html);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can write an app that would copy all input from cin into a
I thought this would be pretty easy but I'm running into all sorts of
we are accepting all sorts of national characters in UTF-8 string on the input,
After reading all sorts of Stackoverflow postings and various documentation including some on http://code.google.com/p/google-api-java-client/
At the moment I'm using all sorts of if statements and substrings in order
currently I have an app that creates all sorts of different requests to Facebook
I tried to display the url using all sorts of methods of HttpRequest, I
I have code which works in all sorts of different situations, including when copying
I am doing a greeting card app.I do all sorts of stuff on my
The following function rewrites urls from news and product titles that contain all sorts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.