 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Omar Mahanna Guest
|
Posted: Sun Jun 19, 2005 6:13 am Post subject: How to insert image in word (OleContainer) |
|
|
Iam Use Delphi 7.0 , use OleContainer to open in my form.
|
|
| Back to top |
|
 |
jacques oberto Guest
|
Posted: Mon Jun 20, 2005 8:30 am Post subject: Re: How to insert image in word (OleContainer) |
|
|
"Omar Mahanna" a écrit
| Quote: | Iam Use Delphi 7.0 , use OleContainer to open in my form.
|
The simplest way is to use the clipboard:
var
Word: olevariant;
[...]
Word := CreateOleObject('Word.Application');
Word.Visible := True;
Word.Documents.Add;
[...]
Clipboard.Assign(BMP);
Word.Selection.Paste;
[...]
Jacques
|
|
| Back to top |
|
 |
Marin Atanasov Guest
|
Posted: Thu Jun 30, 2005 10:29 am Post subject: Re: How to insert image in word (OleContainer) |
|
|
| Quote: | var
Word: olevariant;
[...]
Word := CreateOleObject('Word.Application');
Word.Visible := True;
Word.Documents.Add;
[...]
Clipboard.Assign(BMP);
Word.Selection.Paste;
[...]
I don't think it is good idea. Documentations say that you can't use |
clipboard without "user permission" i.e. you can put something in the
Clipboard only when user asks (Selects Copy, Cut commands).
I think that better approach is:
----------
procedure TForm1.Button1Click(Sender: TObject);
Var
Word : OleVariant;
Doc : OleVariant;
shape : InlineShape;
begin
Word := CreateOleObject('Word.Application');
Word.Visible := True;
Doc := Word.Documents.Add;
shape := Word.Selection.InlineShapes.AddPicture(FileName := 'C:Documents
and SettingsMarinMy DocumentsMy PicturesMacki 9.jpg',
LinkToFile:=False, SaveWithDocument:=True);
end;
----------------
You can also try use:
Word.Selection.InlineShapes' methods like
AddOLEObject(), AddOLEControl()
|
|
| 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
|
|