Some changes can be easily done in RB in combination with a Word macro.
In your project you could change for example every title of some text
into "<h1>" + myTitle and the text into "<h2>" + myText, etc.
In Word you can make a macro "Foo", including for example:
With Selection.Find
.Replacement.Style = ActiveDocument.Styles("Heading 1")
.Execute findtext:="<h1>", replacewith:="", Replace:=wdReplaceAll
.Replacement.Style = ActiveDocument.Styles("Heading 2")
.Execute findtext:="<h2>", replacewith:="", Replace:=wdReplaceAll
.
. and so on.
In RB you can simply call the script:
on run
tell application "Finder"
set thePath to application file id "MSWD" as string
tell application "Microsoft Word"
do script "Foo"
quit saving no
end tell
end tell
end run
Hope you get an idea.
Johan Simons
On 08/04/2006, at 8:34 PM, stephane richard wrote:
Here's a good place to start:
Automating MS Word in RealBASIC
http://home.nethere.net/dja1701/technical_writing/OtherWriting/
WordTutorial.PDF
Stephane Richard
----- Original Message ----- From: "Chris Malumphy"
<[EMAIL PROTECTED]>
To: "REALbasic Network Users Group" <realbasic-
[EMAIL PROTECTED]>
Sent: Saturday, April 08, 2006 2:23 PM
Subject: Re: Creating a Word Document from a Database
I have Word. So where do I learn about WordAutomation.
From: "Stephane Pinel" <[EMAIL PROTECTED]>
Date: 08 Apr 2006 18:30:00 +0200
Have you considered WordAutomation ? In this case you will need
office installed on the computer that runs your app. But it should
be a solution.
Stephane
-----Original Message-----
From: Chris Malumphy <[EMAIL PROTECTED]>
I would like to create a Word document from information that I
currently have in a Database. I have no problem extracting the
data from my DB using RB. What I need to learn is how to format
the output for Word.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>