Hello Owen,

> I understand that Word sends stuff to the clipboard as text, rtf, and
> in Word internal formats(?). At the moment the only way to get stuff
> out of Word via ppro and the clipboard is text, which obviously misses
> out all the formatting.
> If I can get access to the raw rtf, I can run the regex stuff on it
> to convert it to html in the form I want...

You can do what you want by using a PowerPro script to remote control
any word processor, such as Word, Abiword, Atlantis, or Open Office,
by using Keys commands to send things like Ctrl-c, Ctrl-v,
or Alt-F then some key for things on Word's File menu,
or Alt-E ... for things on Word's Edit menu.

First, manually select the portion of your Word document which
you wish to convert. Then execute your PP hotkey to run your script.

If the script executes Keys ^c, while Word is active,
then the clipboard will include the rtf format.

The script can then start a new wordprocessor file, paste into it
by sending Ctrl-v, save as name.rtf, close that word processor window,
read the contents of name.rtf into a PP variable, using file.readall(),
use regex on it to change the rtf codes to html codes, then
save as an .htm file using file.writeall.

---------------------------------------------------------------

Although .rtf is supposedly a standard, you will find that
you get different results from different word processor apps
when they save as .rtf.
So experiment with a few wp apps to see which provides the
most suitable rtf file for your purposes, i.e. needing fewer
changes when you convert the rtf code to html code.

For example, when I pasted some formatted stuff from Word into Abiword,
then save as .rtf, the file was 6,866 bytes.
That's because Abiword makes a big header in its rtf files.

Pasting exactly the same stuff into a new doc in MS Word,
then save as rtf, the file was 4,744 bytes.

When I pasted the same stuff into a new node in Keynote,
then Export the node as an rtf file, the .rtf file was only 897 bytes!

So it might be best to use KeyNote as the intermediate word
processor. Then you will start with a minimal rtf file.

Alan



Attention: PowerPro's Web site has moved: http://www.ppro.org



SPONSORED LINKS
Computer monitoring software Power pro Computer and internet software
Free computer monitoring software


YAHOO! GROUPS LINKS




Reply via email to