Create word document

Just starting out? Need help? Post your questions and find answers here.
donSHAYA
User
User
Posts: 95
Joined: Wed Mar 25, 2009 9:57 am

Create word document

Post 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
User avatar
Arctic Fox
Enthusiast
Enthusiast
Posts: 609
Joined: Sun Dec 21, 2008 5:02 pm
Location: Aarhus, Denmark

Re: Create word document

Post 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.
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: Create word document

Post 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)
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: Create word document

Post by Rook Zimbabwe »

Also PurePDF!
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
donSHAYA
User
User
Posts: 95
Joined: Wed Mar 25, 2009 9:57 am

Re: Create word document

Post by donSHAYA »

Ok. Thanks for all your supplies. Really helpful and fast ;)
Post Reply