inserting tables

K

Kevin

I'd like to know if anyone has found an easy way to insert tables from data
that does not come from Excel. I found I can copy and paste data from Excel
and it is a real table in ON, as long as I "keep source formating". All other
attempts by me fail.

For example, it's easy to create table-like data with PowerShell. I can even
get it into ON with:

SOME-COMMAND | out-printer "send to onenote 2007"

Then I can "copy text" from that image and paste it to have real text
instead of a picture, but it's not a table. Copy-n-paste from a screen (a
PowerShell window, Notepad, etc) has similar results.

I'm starting to suspect that the only way to get this done is to write code
that creates the XML structure for the data, following the ON schema, and
somehow gives that to ON -- which suggests I'd be writing a PowerToy. So is
there a way to get the job done short of having to goto thru that work?

Thanks,
Kevin
 
E

Erik Sojka

I'm a little cvonfused about what you are expecting. Is the text being
copied from the PS windows or from Notepad in a table format? I am not
sure how that is possible coming from Notepad.

I just did a quick copypasta test from an Access Table and that data comes
in as a Table in OneNote. If the source data is already in table format
when it is placed on the Clipboard, ON should recreate that when pasting.
If the source data isn't in table format, even if it looks like a table or
is manually formatted as such (maybe with extra spaces and tabs?) it won't
paste as a Table in OneNote.
 
K

Kevin

By table format, I mean the text is lined up in columns like a table. To give
a really specific example, do this in PowerShell:

PS C:\Documents and Settings\kebranne> Gwmi win32_logicaldisk |
Select-Object -Property Caption,VolumeName,Name,Size,Fre
eSpace | ForEach-Object -Process {$_.FreeSpace =
$([system.math]::round(($_.FreeSpace)/1024/1024/1024,2)); $_.Size = $([
system.math]::round(($_.Size)/1024/1024/1024,2)); $_} | format-table -auto

It producds 5 columns of text and 12 rows (on my machine), with the first 2
rows being the header. I can do things like this, record it for future
reference to check against for how things *should* be when problems arise.
The header will define the columns.

It would be a little more work, but I'd be happy even if "the way" forced me
to give it CSV formated data so it would know where the columns are.

I've never used Access, so I have no idea how that works as far as
copy-n-paste. Excel apparently gives the data in "table format" when sent to
the clipboard. Perhaps that is the best way to ask my question: How do I
create data that "looks like" table data to the clipboard so that I can paste
it into ON-2007 and have it paste as a real table? My source will be "simple
text", but I can dress it up (CSV, HTML table tags, XML tags, ...).

Thanks,
Kevin
 
R

Rainald Taesler

Kevin said:
I'd like to know if anyone has found an easy way to insert tables
from data that does not come from Excel. I found I can copy and paste
data from Excel and it is a real table in ON, as long as I "keep
source formating". All other attempts by me fail.

Does Wordaccept the data as a table when paste onto a document?

Rainald
 
K

Kevin

Rainald Taesler said:
Does Wordaccept the data as a table when paste onto a document?

As a real table? No. The best I can do with Word (2003) is to change the
font to a monospaced one to sorta make it look like a table. I do this with
ON-2007 as well, but it's not a real table (which are easier to manipulate).

I'm suspecting that what I want isn't easily possible, and to do this
correctly, I'll have to delve into writing a PowerToy. Bummer.

Kevin
 
R

Rainald Taesler

Kevin said:
As a real table? No. The best I can do with Word (2003) is to change
the font to a monospaced one to sorta make it look like a table.

That's what I thought.
And if even Word can not do it, one can not expect that ON might be able
to.
I do this with ON-2007 as well, but it's not a real table (which are
easier to manipulate).

I'm suspecting that what I want isn't easily possible, and to do this
correctly, I'll have to delve into writing a PowerToy.

That's what I wanted to suggest.

You may have a look at John Guin's "Text Importer" PowerToy
http://blogs.msdn.com/johnguin/archive/2007/04/30/customer-feedback-results-in-another-powertoy.aspx

as well as his PowerToy for importing text from the projekt Gutenberg
http://blogs.msdn.com/johnguin/archive/2007/05/31/a-tool-to-import-texts-from-project-gutenberg.aspx

Good luck
Rainald
 

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