11-04-2011, 05:28 PM
وعليكم السلام ورحمة الله وبركاته
جرب:
المصدر:
جرب:
كود :
procedure TForm1.Button1Click(Sender: TObject);
var
range: Variant;
FileName, Password: OLEVariant;
begin
try
Word := GetActiveOleObject('Word.Application');
except
Word := CreateOleObject('Word.Application');
end;
FileName := 'C:\temp\t2.doc';
Password := 'thepass';
//open the doc
Word.Documents.Open (FileName, EmptyParam, EmptyParam, EmptyParam,
Password, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam);
//copy the contents
range := Word.ActiveDocument.Content;
range.Select;
range.Copy;
//paste it into the OleContainer
OleContainer1.CreateObject('Word.Document.8',False);
OleContainer1.Paste;
OleContainer1.DoVerb (ovPrimary);
end;كود :
http://www.delphigroups.info/2/10/943605.html
