Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Bild in Word einfügen (https://www.delphipraxis.net/46423-bild-word-einfuegen.html)

glkgereon 24. Mai 2005 20:15


Bild in Word einfügen
 
Hi

ich weiss jetzt nicht ob das das richtige forum ist...

ich würde gerne ein Bild (eigentlich mehrere) in ein Worddokument einfügen.

perfekt wäre es wenn jedes bild auf eine neue seite käme...

ich weiss das es irgendwie mit Olexxx geht/gehen muss, hab aber keine ahnung wie :(

digga 25. Mai 2005 17:07

Re: Bild in Word einfügen
 
Vielleicht hilft dir das weiter ...

Delphi-Quellcode:
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComObj, StdCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
var winword: variant;
begin
  try
    winword := GetActiveOleObject('Word.Application')
  except
    winword := CreateOleObject('Word.Application');
  end;

  winword.Documents.Add;

  winword.Selection.InlineShapes.AddPicture('D:\Eigene Dateien\Eigene Bilder\DSCF0092.JPG', false, true);
  winword.Selection.EndKey(6);
  winword.Selection.InsertBreak(7);
  winword.Selection.InlineShapes.AddPicture('D:\Eigene Dateien\Eigene Bilder\DSCF0096.JPG', false, true);

  // weitere Bilder einfügen ...

  winword.Visible := true;
end;

end.

glkgereon 26. Mai 2005 08:16

Re: Bild in Word einfügen
 
supi...wird soofort getestet...

was heisst das false, True bei AddPicture?

toms 26. Mai 2005 08:26

Re: Bild in Word einfügen
 
Zitat:

Zitat von glkgereon
supi...wird soofort getestet...

was heisst das false, True bei AddPicture?

Schau mal in der VBA Hilfe nach. :idea:


Zitat:

expression.AddPicture(FileName, LinkToFile, SaveWithDocument, Range)

FileName Required String. The path and file name of the picture.

LinkToFile Optional Variant. True to link the picture to the file from which it was created. False to make the picture an independent copy of the file. The default value is False.

SaveWithDocument Optional Variant. True to save the linked picture with the document. The default value is False.

Range Optional Variant. The location where the picture will be placed in the text. If the range isn't collapsed, the picture replaces the range; otherwise, the picture is inserted. If this argument is omitted, the picture is placed automatically.

glkgereon 27. Mai 2005 08:24

Re: Bild in Word einfügen
 
ok, funzt alles, aber wo finde ich die VBA-Hilfe?

teebee 27. Mai 2005 09:11

Re: Bild in Word einfügen
 
VBA-Reference Word 2003


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz