| View previous topic :: View next topic |
| Author |
Message |
Martin schaefer Guest
|
Posted: Mon Nov 17, 2003 2:38 pm Post subject: Word Find/Replace with Delphi 4 |
|
|
Hi,
Actually I work witz Delphi 4 and I have to find an replace
single Words in an Word document. Ok I´ve inserted an OLE-Container
in my Form and I found a Function Find.Execute in the Word_TlB.
But I´ve problems to handle that. Is there somenone who can give me
a short example ??
By // Martin
|
|
| Back to top |
|
 |
Deborah Pate (TeamB) Guest
|
Posted: Mon Nov 17, 2003 3:33 pm Post subject: Re: Word Find/Replace with Delphi 4 |
|
|
<
Actually I work witz Delphi 4 and I have to find an replace
single Words in an Word document. Ok I´ve inserted an
OLE-Container in my Form and I found a Function
Find.Execute in the Word_TlB.
var
Doc: OleVariant;
...
OleContainer1.DoVerb(ovShow);
Doc := OleContainer1.OleObject;
Doc.Range.Find.Execute('old',
ReplaceWith := 'new', Replace := wdReplaceAll);
--
Deborah Pate (TeamB) http://delphi-jedi.org
TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html
|
|
| Back to top |
|
 |
Martin schaefer Guest
|
Posted: Mon Nov 17, 2003 4:17 pm Post subject: Re: Word Find/Replace with Delphi 4 |
|
|
Hi Deborah
Fine your Code does exactly what I want. But there is a small
problem. After the
OleContainer1.DoVerb(ovShow);
command the olecontainer views the Toolbars very cruel outside of my
application. is there a possibility to avoid this ?
// Martin
|
|
| Back to top |
|
 |
Deborah Pate (TeamB) Guest
|
Posted: Mon Nov 17, 2003 5:23 pm Post subject: Re: Word Find/Replace with Delphi 4 |
|
|
<
the olecontainer views the Toolbars very cruel outside of
my application. is there a possibility to avoid this ?
Sorry, I don't think cruel is the word you want, so I'm not
sure what the problem is. IME olecontainers work best if
they're on a panel (aligned alClient) with another panel
(aligned alTop, Locked = False) above them for the toolbars
to go in. If that doesn't help, please post again with
another explanation of the problem. :)
--
Deborah Pate (TeamB) http://delphi-jedi.org
TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html
|
|
| Back to top |
|
 |
Martin schaefer Guest
|
Posted: Mon Nov 17, 2003 6:13 pm Post subject: Re: Word Find/Replace with Delphi 4 |
|
|
TeamB wrote:
Thanks Deborah
Found a solution by accident
Doc.CommandBars['Text'].Enabled := False;
it is possible to set the commandbars invisible
that seems to be the solution. Perhaps my efect happend
because i use the olecontainer i an MDI-Child..
One last Question for today
how can i close the document
when i made my changes ??
// Martin
|
|
| Back to top |
|
 |
Deborah Pate (TeamB) Guest
|
Posted: Mon Nov 17, 2003 10:21 pm Post subject: Re: Word Find/Replace with Delphi 4 |
|
|
<
how can i close the document
when i made my changes ??
OleContainer.Close;
OleContainer.DestroyObject;
--
Deborah Pate (TeamB) http://delphi-jedi.org
TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html
|
|
| Back to top |
|
 |
Martin schaefer Guest
|
Posted: Wed Nov 19, 2003 3:51 pm Post subject: Re: Word Find/Replace with Delphi 4 |
|
|
Hello Deborah,
with your help I´ve got my application so far on the way.
But there is still something...
Is there a possibility to completely switch of the toolbars?
The OleContainer is used in my App only for showing autoreplace and
printing some documents and so there is no need for the word toolbars
By Martin
|
|
| Back to top |
|
 |
Martin schaefer Guest
|
Posted: Thu Nov 20, 2003 8:49 pm Post subject: Re: Word Find/Replace with Delphi 4 |
|
|
Hello,
Well I recognized, that there is no way do deactivate the toolbars
completely. So I forced them in a panel by setting the locked property
in the panels outside my wished area. Well It´s not the way I like it,
but actually a acurrate compromise...
Thanks for the help !
By Martin
|
|
| Back to top |
|
 |
|