Group:  Other Microsoft Office Products ยป microsoft.public.onenote
Thread: What clipboard format does ON accept?

Geek News

What clipboard format does ON accept?
Doug C. 5/21/2007 2:25:00 AM
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?
Re: What clipboard format does ON accept?
Ilya Koulchin <ikoulchine[ at ]hotmail.com> 5/22/2007 8:10:09 PM
Doug C. wrote:
[Quoted Text]
> 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
Re: What clipboard format does ON accept?
Doug C. 5/22/2007 9:19:00 PM
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

"Ilya Koulchin" wrote:

[Quoted Text]
> Doug C. wrote:
> > 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
>
Re: What clipboard format does ON accept?
Ilya Koulchin <ikoulchine[ at ]hotmail.com> 5/23/2007 2:16:39 AM
Doug C. wrote:
[Quoted Text]
> 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

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net