Importing & Exporting MS Word Documents

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Importing & Exporting MS Word Documents

Post by deeverd » Thu Jan 31, 2008 6:07 pm

Hello Everyone,

Yes, I know this has to be quite a basic question, but it's one that I have somehow missed finding an answer for, so I humbly ask:

How does one import a MS Word document without also getting all the strange computer symbols into the field into which it is imported? I know how to import and export documents from inside Revolution, but basically, what I'm trying to do is import a formatted document, whether it is a MS Word .doc or .rtf document etc., and then convert it to a plain old text file ".txt" without any formatting.

I've been trying script related to htmlText and setting the text to "Courier," and many other things, but the process still eludes me.

Once again, any suggestions are greatly appreciated. Thanks, deeverd

Mark Smith
Posts: 179
Joined: Sat Apr 08, 2006 11:08 pm
Contact:

Post by Mark Smith » Fri Feb 01, 2008 12:54 am

I think your best bet here is to use 'rtf' documents.
Though I don't think Rev's rtf implementation is perfect, fields can have a 'rtfText' property, so you can

Code: Select all

set the rtfText of fld 'input' to url("binfile:/yourRtfDocument).
I don't think there's any easy way to directly import '.doc' documents.

Best,

Mark

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Feb 01, 2008 2:03 am

The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Post by deeverd » Fri Feb 01, 2008 10:39 pm

Thanks,

This weekend, I will definitely be testing out this script and digesting the link information that was also sent. Actually, I had seen that link and forum information prior to posting, but have only very limited experience with VB (I played with it a couple months ago to add some extra functionality to PowerPoint), so I didn't pay a lot of attention to it. VB definitely impressed on me how much more user-friendly Revolution scripting is to use. I had even followed the link from Richard Gaskin to check out the software for importing Word 2007, but I am much more inclined to make, rather than buy such software, because I need it to implement it into my own programs.

For instance, my purpose for being able to import Word docs more cleanly is for a little program I am building for the teachers at the high school where I work. Its purpose is to allow them to import a document and run it through the program, so that all the common "general service language" words of that text will be taken out, leaving behind a list of those words which should mostly likely be included in the student's vocabulary list for that week. In other words, it will filter out all the words they should already know, and narrow their text down to just those handful of words that the teachers most likely will need to explain their meaning to them.

Right now, making the software to do that is no problem, it's just getting a clean copy of the document. But, I will try these suggestions and report back. I also just remembered another resource that I nearly forgot along these lines. I seem to recall there's a sample project called "Open Anything" which might also be a great source of info.

Thanks again, and have a great weekend. Cheers, deeverd

Post Reply