; end; //保存 procedure TMyWord.Save(FileName: string); var OFilename: olevariant; begin OFilename := FileName; FDoc.SaveAs(OFilename); end; //插入图片 procedure TMyWord.AddPicture(FileName: string); var LinkToFile, SaveWithDocument, Range: olevariant; //index: olevariant; begin //index := 0; //Range := FDoc.Bookmarks.Item(index).Range; //Range:=Fdoc.GoTo_; Range := Self.FWord.Selection.Range; LinkToFile := False; SaveWithDocument := True; FWord.Selection.InlineShapes.AddPicture(FileName, LinkToFile, SaveWithDocument, Range) end; //移到最后 procedure TMyWord.MoveEnd(); var Unit_: olevariant; Extend: olevariant; begin Unit_ := wdStory; Extend := wdMove; FWord.Selection.EndKey(Unit_, Extend); end; //合并 procedure TMyWord.CellsMerge(); begin FWord.Selection.Cells.Merge; end; initialization finalization { if FMyWord <> nil then FMyWord.Free; } end.