Home > Archive > Programming with dBASE > March 2006 > Re: MS Word in a form









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: MS Word in a form
Peter Krarup

2006-03-31, 7:25 am

I raised this question long time ago, but had no answers.
Perhaps I should forward it to another newsgroup - like the ole-forum ?
Kind regards
Peter Krarup

Peter Krarup Wrote:

> I have sent following to the group dde-ole-ddl-winapi but got no answers
> there, so
> now I try here:
>
> Hi all good helpers,
>
> I have an application where I show a Word-document in a form using the
> following:
>
> this.OLEWORD1 = new OLE(this)
> with (this.OLEWORD1)
> onOpen = class::OLEWORD1_ONOP
EN
> dataLink = form.word1.rowset.fields["word"]
> height = 28.5
> left = 0.0
> top = 0.0
> width = 98.0
> border = false
> endwith
>
> function OLEWORD1_onOpen
> form.rowset.fields[ "word" ].replaceFromFile( fltnvn )
> form.rowset.save( )
> return
> endclass
>
> My problem is that when the document have more pages they are not shown.
>
> Do you have any idea to show them.
>
> Kind regards
> Peter Krarup
>
> P.S. I like to show the document in a form instead of using:
> w = new OleAutoClient("Word.Application.9")
> w.Visible = true
> d = w.documents.open(fltnvn)
> release object w
> which works OK, but is not what I want.
>
>
>
>


Rick

2006-03-31, 11:24 am

Peter,

I found this a bit tricky, but here's what I do.

I use an OLE field in a table and display the field on the form. The .doc file is stored in the OLE field using replacefromfile(). I also have a field storing the path and name of the .doc file.

One caution, normally if they click on an OLE field it attempts to load the contents into what ever app (in this case Word) is appropriate to the contents. I had to prevent that, and instead gave them an option on the screen to edit it in word.

Hope this helps,
Rick

Peter Krarup Wrote:

> I raised this question long time ago, but had no answers.
> Perhaps I should forward it to another newsgroup - like the ole-forum ?
> Kind regards
> Peter Krarup
>
> Peter Krarup Wrote:
>
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com