 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
CyberDiggs Guest
|
Posted: Mon Apr 12, 2004 4:07 pm Post subject: Using word in activeX |
|
|
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 |
|
 |
|
|
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
|
|