🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.misc
1 messages
1 total messages Started by bart Wed, 22 Sep 1999 00:00
How to find one word in a document and insert text?
#82
Author: bart
Date: Wed, 22 Sep 1999 00:00
36 lines
1837 bytes
How to find one word in a document and insert text?

I use word automation in Delphi to start Word and open an existing
document. I got this document from another person so I can not add
bookmarks or add a macro to it. What I must do is find one word in the
document and then add some text after this word. I know I can do this
with the command insertafter, but I don't know how to find this one
word and select/use it to place my text in the document.

I can't find the solution in the VBAWRD8.HLP file :(
All help appreciated . . .

uses Word_tlb;

private
    Msw: _Application;
    Doc: _Document;
end;


procedure ....
var Doc_Name: OleVariant;
begin
    Msw := CoApplication_.Create;
    Msw.Visible := True;

    Doc_Name := 'c:\test.doc';
    Doc :=
Msw.Documents.Open(Doc_name,OleFalse,OleFalse,OleTrue,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam);


    // here comes some other code to manipulate the document.
    // and here I try to insert my text!!!
end;
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads