What clipboard format does ON accept?

D

Doug C.

There's a recent thread about ON's inability to properly paste color-coded
text from source code in .net without first going through Word. Which is sad
because I can paste code snippets it into even Wordpad with proper formatting.

So I tried the CopyAsHTML add-in for Visual Studio, which seems to make a
pretty simple/straight-forward html div with styles inlined. However, when
pasted into ON I get nothing except a large empty text box.

So my question is, what is ON's magical? clipboard format that it will
accept from Word such that it retains proper formatting?
 
I

Ilya Koulchin

Doug said:
So I tried the CopyAsHTML add-in for Visual Studio, which seems to make a
pretty simple/straight-forward html div with styles inlined. However, when
pasted into ON I get nothing except a large empty text box.

So my question is, what is ON's magical? clipboard format that it will
accept from Word such that it retains proper formatting?


You can paste to OneNote in a wide variety of formats, including html.
In this particular case however, the paste fails since OneNote requires
the html content on the clipboard to be wrapped in HTML and BODY tags.
We're considering removing this restriction in a future version; in the
meantime, you could contact the add-in developer and see if it would be
possible to create a version of the add-in that publishes html with the
required tags, which would allow the add-in to paste into OneNote.

Ilya
 
D

Doug C.

Thanks Ilya. I realized this was probably the problem once I played with
CopyAsHTML add-in some more. Luckily he has posted the source code and I
will attempt to modify it to have the option to wrap the <div> with a <html>
and <body> tag.

Was there any reason the default RTF(?) copy format that .net 2005 produces
does not paste properly with formatting as it does into Word? Or rather, was
this something that was a bug to be fixed or just a feature that needed to be
added at some point?

thanks
-doug
 
I

Ilya Koulchin

Doug said:
Was there any reason the default RTF(?) copy format that .net 2005 produces
does not paste properly with formatting as it does into Word? Or rather, was
this something that was a bug to be fixed or just a feature that needed to be
added at some point?

OneNote does not support the RTF format at all. The native .one format
is not RTF based, so it's not quite as simple as flipping a switch and
having it work.
We're considering adding RTF support in the next version, but no promises.

Ilya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top