Page 1 of 1

Create word document

Posted: Mon Mar 22, 2010 9:09 pm
by donSHAYA
Hi all

How do you create a word document, and add text with like word-features (Bold, size, font, Paragraphs etc...) ?

Is it also possible for Mac?

Thanks

Re: Create word document

Posted: Mon Mar 22, 2010 9:26 pm
by Arctic Fox
For Windows you will probably use a COM application like COMate, but Word needs to be present on the computer.
There are some good examples in the COMate package on how to communicate with Word.

I do not know how to do this on MacOS, though.

Re: Create word document

Posted: Mon Mar 22, 2010 10:25 pm
by Foz
With great difficulty :)

You would find it far easier to generate an RTF file instead, as it's just text based (and very much cross platform). For example:

Code: Select all

OpenFile(0, "test.rtf")
WriteStringN(0, "{\rtf1")
WriteStringN(0, "{\fonttbl")
WriteStringN(0, "{\f0 Arial;}")
WriteStringN(0, "{\f1 Times New Roman;}")
WriteStringN(0, "}")
WriteStringN(0, "\f0\fs60 PureBasic Unleashed\par")
WriteStringN(0, "\f1\fs20 Feel the {\b Pure...} Power!\par")
WriteStringN(0, "}")
CloseFile(0)

Re: Create word document

Posted: Mon Mar 22, 2010 11:14 pm
by Rook Zimbabwe
Also PurePDF!

Re: Create word document

Posted: Tue Mar 23, 2010 1:10 am
by donSHAYA
Ok. Thanks for all your supplies. Really helpful and fast ;)