Board index » delphi » Accessing WordBasic via Delphi...

Accessing WordBasic via Delphi...

Is there any way to access the functionality of MS Word's WordBasic
macro language via Delphi?  In VisualBasic, the following code would
achieve this goal:

        Dim Word as Object
        Set Word = CreateObject("Word.Basic")

At this point, WordBasic's functions are accessed like this:

        Word.Insert MyString$
        Word.FormatFont .Points:="12"

etc., etc.

Does anyone know of a similarly easy way to do this in Delphi?  I
despise the slowness of VB and am therefore trying to avoid using it.
Likewise, DDE and OLE seem to be overkill for my simple project
(accessing Word's formatting capabilities for text processing).  
Is it simply a matter of creating a new object, say TWord or
something?  If so, how do I reference the Word API?

If anyone can help, please email me at the address below or repost.
Thank you in advance!

_____________________________________________________________________
Josh Anderson, President
CompactData, Inc.              
5161 Rio Vista Ave.           Headquarters for everything from document
Tampa, FL  33634              imaging to CD publishing to retail sales
(813) 884-0039                of optical drives and scanners.
j...@digital.net
compd...@quark.student.harvard.edu

 

Re:Accessing WordBasic via Delphi...


Quote
In article <4fg50v$...@ddi2.digital.net> Josh Anderson <j...@digital.net> writes:
>Is there any way to access the functionality of MS Word's WordBasic
>macro language via Delphi?  In VisualBasic, the following code would
>achieve this goal:
>        Dim Word as Object
>        Set Word = CreateObject("Word.Basic")
>At this point, WordBasic's functions are accessed like this:
>        Word.Insert MyString$
>        Word.FormatFont .Points:="12"
>etc., etc.

We have developed code to do Word mail-merging and general document handling
in Word or Crystal Reports, which at this moment is not developed into a
postable item but could be.  Interest?  Write...

/mr/
Mike Robinson
sund...@primenet.com

Re:Accessing WordBasic via Delphi...


Quote
In article <4fg50v$...@ddi2.digital.net> Josh Anderson <j...@digital.net> writes:
>Is there any way to access the functionality of MS Word's WordBasic
>macro language via Delphi?  In VisualBasic, the following code would
>achieve this goal:
>        Dim Word as Object
>        Set Word = CreateObject("Word.Basic")
>At this point, WordBasic's functions are accessed like this:
>        Word.Insert MyString$
>        Word.FormatFont .Points:="12"
>etc., etc.
>Does anyone know of a similarly easy way to do this in Delphi?  I
>despise the slowness of VB and am therefore trying to avoid using it.
>Likewise, DDE and OLE seem to be overkill for my simple project
>(accessing Word's formatting capabilities for text processing).  
>Is it simply a matter of creating a new object, say TWord or
>something?  If so, how do I reference the Word API?
>If anyone can help, please email me at the address below or repost.
>Thank you in advance!

YES!

What you want to do is to use the CAPI functions that are discussed in an
Appendix of the "Word Developer's Guide," available at larger bookstores.

AND ... there are Delphi source-files available on the web where you can find
an implementation of those functions, already done for you.

AND SINCE I HAVE AN FTP-SITE ... I took the liberty of re-posting the file in
question to

                ftp.primenet.com/users/s/sundial/wordapi.zip

So that anyone who might read this can quickly find it.  :-)  (Please don't
put that location into any permanent directories, however, because it's
already out on a lot of the bigger sites worldwide and I didn't write it in
the first place.)

/mr/

Re:Accessing WordBasic via Delphi...


In article <4fg50v$...@ddi2.digital.net> j...@digital.net
                                 "Josh Anderson" writes:
...
Quote
> how do I reference the Word API?

...

Get ftp://sunsite.icm.edu.pl/pub/delphi/freeware/wordapi.zip    

This provides units with source code that allow you to write
WLLs (Word Add-In DLLs), also opens the "back door"
of WinWord 6 and the Word API - you may have to modify
the code slightly and recompile with Delphi 2 to work
properly with Word '95

- Chris

--
Christopher J Fynn <cf...@sahaja.demon.co.uk>

Re:Accessing WordBasic via Delphi...


In article <sundial.2328.001A4...@primenet.com>
           sund...@primenet.com "Sundial Services" writes:

Quote
> In article <4fg50v$...@ddi2.digital.net> Josh Anderson <j...@digital.net>
>  writes:

> >Is there any way to access the functionality of MS Word's WordBasic
> >macro language via Delphi?  In VisualBasic, the following code would
> >achieve this goal:

> >        Dim Word as Object
> >        Set Word = CreateObject("Word.Basic")

> >At this point, WordBasic's functions are accessed like this:

> >        Word.Insert MyString$
> >        Word.FormatFont .Points:="12"

> >etc., etc.

> We have developed code to do Word mail-merging and general document handling
> in Word or Crystal Reports, which at this moment is not developed into a
> postable item but could be.  Interest?  Write...

> /mr/
> Mike Robinson
> sund...@primenet.com

Also check out:  ftp://sunsite.icm.edu.pl/pub/delphi/freeware/wordapi.zip

- Chris

--
Christopher J Fynn <cf...@sahaja.demon.co.uk>

Re:Accessing WordBasic via Delphi...


        With delphi 2, you'd probably just want to use OLE Automation as it's very easy- if it'll do what you want of course.

--
Delphi and Paradox Consultant. Member: Borland Delphi Technical Support

       Paradox Web Page: http://www.pagescape.com/fire/pdox/

          My words are my own, I don't speak for Borland.

Re:Accessing WordBasic via Delphi...


Quote
sund...@primenet.com (Sundial Services) wrote:
>In article <4fg50v$...@ddi2.digital.net> Josh Anderson <j...@digital.net> writes:
>>Is there any way to access the functionality of MS Word's WordBasic
>>macro language via Delphi?  In VisualBasic, the following code would
>>achieve this goal:
>>        Dim Word as Object
>>        Set Word = CreateObject("Word.Basic")
>>At this point, WordBasic's functions are accessed like this:
>>        Word.Insert MyString$
>>        Word.FormatFont .Points:="12"
>>etc., etc.
>>Does anyone know of a similarly easy way to do this in Delphi?  I
>>despise the slowness of VB and am therefore trying to avoid using it.
>>Likewise, DDE and OLE seem to be overkill for my simple project
>>(accessing Word's formatting capabilities for text processing).  
>>Is it simply a matter of creating a new object, say TWord or
>>something?  If so, how do I reference the Word API?
>>If anyone can help, please email me at the address below or repost.
>>Thank you in advance!
>YES!
>What you want to do is to use the CAPI functions that are discussed in an
>Appendix of the "Word Developer's Guide," available at larger bookstores.
>AND ... there are Delphi source-files available on the web where you can find
>an implementation of those functions, already done for you.
>AND SINCE I HAVE AN FTP-SITE ... I took the liberty of re-posting the file in
>question to
>            ftp.primenet.com/users/s/sundial/wordapi.zip
>So that anyone who might read this can quickly find it.  :-)  (Please don't
>put that location into any permanent directories, however, because it's
>already out on a lot of the bigger sites worldwide and I didn't write it in
>the first place.)
>/mr/

You might want to check the wordapi.zip file. I tried to get it but it
is a zero byte file.

Rick Austin
raus...@mindspring.com

Re:Accessing WordBasic via Delphi...


In article <4flhp1$...@firebrick.mindspring.com>
           raus...@mindspring.com "Rick Austin" writes:

Quote
> sund...@primenet.com (Sundial Services) wrote:
...
> >AND SINCE I HAVE AN FTP-SITE ... I took the liberty of re-posting
> > the file in question to

> >               ftp.primenet.com/users/s/sundial/wordapi.zip
...
> You might want to check the wordapi.zip file. I tried to get it but it
> is a zero byte file.

...

Try: ftp://sunsite.icm.edu.pl/pub/delphi/freeware/wordapi.zip
- I got a copy from there with no problem.

Chris

-
Christopher J Fynn <cf...@sahaja.demon.co.uk>

Re:Accessing WordBasic via Delphi...


Quote
sund...@primenet.com (Sundial Services) wrote:
>In article <4fg50v$...@ddi2.digital.net> Josh Anderson <j...@digital.net> writes:
>>Is there any way to access the functionality of MS Word's WordBasic
>>macro language via Delphi?  In VisualBasic, the following code would
>>achieve this goal:
>>        Dim Word as Object
>>        Set Word = CreateObject("Word.Basic")
>>At this point, WordBasic's functions are accessed like this:
>>        Word.Insert MyString$
>>        Word.FormatFont .Points:="12"
>>etc., etc.
>We have developed code to do Word mail-merging and general document handling
>in Word or Crystal Reports, which at this moment is not developed into a
>postable item but could be.  Interest?  Write...
>/mr/
>Mike Robinson
>sund...@primenet.com

I've tried to get some help on pasting info into predefined variables
in Word6, Write and AmiPro how is it done? Some applications just use
a variable that looks like this <customer             >. But there's
no documentation on how this is done.

All help appreciated
Marcus

Re:Accessing WordBasic via Delphi...


A company has created a TOleAutomation Component, for all kinds of OLE
automation, and with right coding it can support most WordBasic commands.
Check Delphi Super Page for OLEAUTTR.ZIP

Other Threads