Archive of UserLand's first discussion group, started October 5, 1998.

Script that converts Word to html

Author:Tommy Sundström
Posted:4/20/1999; 9:44:29 AM
Topic:Processing Word as Input?
Msg #:5136 (In response to 5114)
Prev/Next:5135 / 5137

Here's an extremely simple script for mac that takes a word file, uses Word 98 to convert it to html, and puts it into a file.

To use it, you need

o Word 98. No windows open (specially not the window of the file you want to convert)

o Word 98 glue (this you can do yourself, there is a script in Frontier to produce it).

o A textfile named test.htm in the right location.

Naturally, this script can be made more functional. But see it as a proof of concept, and a chance to test conversion quality and speed.

on action (f) {
	// takes the path to a Word-file, converts it to html and replaces the content of test.htm with it.
	local {
	with objectModel, Word98 {
		try {
			return(save (document[1], saveIn: "Player2:test.htm", as:"html"))}
		else {
msg(action ("Player2:testdok.doc"))

This page was archived on 6/13/2001; 4:49:25 PM.

© Copyright 1998-2001 UserLand Software, Inc.