BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using word in activeX

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ActiveX Controls Development
View previous topic :: View next topic  
Author Message
CyberDiggs
Guest





PostPosted: Mon Apr 12, 2004 4:07 pm    Post subject: Using word in activeX Reply with quote



Hi, I am trying to write an activeX control for Word that I can use to load
an document from a stream received from SharePoint 2003. So far I can get
the screen to open and load word so now I am trying to interact with the
application.

First of all I'd like to make sure that the application instance has been
created and then try entering some text.

this procedure works to create the document:
---------------------------------------------------
procedure TTestX.CreateNewDoc;
begin
OleContainer1.CreateObject('Word.Document', False);
OleContainer1.AllowInPlace := True;
OleContainer1.DoVerb(ovPrimary);
OleContainer1.OleObject.Application.Selection.TypeText('Hey Now!');
end;

Now I am trying to expose a method to let me do this using Javascript but I
don't know the best way to access the application object and get some syntax
help. I am trying something like this, which I know doesn't work but I was
hoping one of you experts could point me in the correct direction...
procedure TTestX.AddTextToDoc(const MsgText: WideString);
var
oWord :TWordApplication;
begin
if OleContainer1.State <> osEmpty then
begin
oWord := IDispatch(OleContainer1.OleObject.Application) as _Application;
oWord.Selection.TypeText('yo buddy');
end;
end;


Thanks in advance.
Hal


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ActiveX Controls Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.