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

Related Questions

I have just inherited a server application, however it seems that the only copy
It seems that tomcat is a web application server and EAR cannot be deployed
It seems that a List object cannot be stored in a List variable in
It seems like a general purpose need on the web that a page can
i am trying to get a chat working that is a copy paste from
  I have a file copy program that takes from one file and pastes in
Seems that CPPPATH does not work env = Environment() target = 'app' sources =
Seems that requirements on safety do not seem to like systems that use AI
Seems that even after unchecking the option in the PyDev/Debug preferenecs pane to launch
that seems tricky. My IPad freezes and it seems that this line of code

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.