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

  • Home
  • SEARCH
  • 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 146187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:33:27+00:00 2026-05-11T08:33:27+00:00

It seems that when you copy something from a web browser to the clipboard,

  • 0

It seems that when you copy something from a web browser to the clipboard, at least 2 things are stored:

  1. Plain text
  2. HTML source code

Then it is up to the software that you are pasting into can determine which one it wants. When pasting into MS Excel 2003, you have a paste special option to paste HTML, which will paste the formatted HTML (as it is displayed by the browser).

What I want to do is paste the actual source code as plain text. Can this be fetched from the clipboard in VBA?

Edit I’m trying to access all the source-code of the copied HTML, including the tags.

  • 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. 2026-05-11T08:33:27+00:00Added an answer on May 11, 2026 at 8:33 am

    This time I’ve read the question properly and realised coonj wants to get the HTML from the clipboard including tags.

    I believe this is reasonably difficult. You need to read the clipboard using Windows API calls. And then, parse the resulting CF_HTML string which has some wacky headers added on top of the HTML.

    1. Microsoft Knowledge Base article with Windows API code to read the CF_HTML from the clipboard (function GetHTMLClipboard).
    2. You will then probably want to ignore the wacky headers. Microsoft documents the format here. An example CF_HTML fragment is shown below. You could probably come up with some guesswork method of skipping the first few lines.

      Version:0.9  StartHTML:71  EndHTML:170  StartFragment:140  EndFragment:160  StartSelection:140  EndSelection:160  <!DOCTYPE>  <HTML>  <HEAD>  <TITLE>The HTML Clipboard</TITLE>  <BASE HREF='http://sample/specs'>   </HEAD>  <BODY>  <!--StartFragment -->     <P>The Fragment</P>  <!--EndFragment -->  </BODY>  </HTML>   

    It might also be worth thinking whether there’s any other way of solving your problem. E,g, Will the browser always be Internet Explorer? Can you get what you need by walking the HTML tree using the COM object model?

    EDIT: coonj has tried this now and says ‘the GetHTMLClipboard function seems to work with both Firefox and IE, and it doesn’t look like it is throwing those headers in there’

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 173k
  • Answers 173k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Maybe you're looking for .toggle? $("#left-nav .block h3").toggle(function(){ $(this).next("ul").slideToggle("fast"); },… May 12, 2026 at 2:45 pm
  • Editorial Team
    Editorial Team added an answer In the containing view, you can use viewWithTag to get… May 12, 2026 at 2:45 pm
  • Editorial Team
    Editorial Team added an answer See the Theming section The jQuery UI Slider plugin uses… May 12, 2026 at 2:45 pm

Related Questions

Currently all our files are stored on a Windows network drive and with 15
We are trying to copy a BO Query Service from one Universe to another.
I frequently hear/read the following advice: Always make a copy of an event before
I want to spawn another process to display an error message asynchronously while the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.