Autor Beitrag
Mike_C
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Sa 13.03.04 12:18 
Hi

Kann man eigentlich Excel oder Word auch aus einer nonVCL Anwendung starten? WEnn ja, weiß jemand wie das geht?

Danke schonmal

Gruß
Mike

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
BungeeBug
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 901



BeitragVerfasst: Sa 13.03.04 13:20 
Hi,

einfach mit ShellExecute.
Mike_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Sa 13.03.04 13:24 
Hi

ja, das geht, aber was mache ich, wenn ich ein Word-Dokument schreiben will? (Das hätte ich vielleicht von vernherein sagen sollen, dass ich von Delphi aus ein Word-Dokument schreiben will, aber keine VCL benutzen möchte! Sorry :? )

Gruß
Mike

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
BungeeBug
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 901



BeitragVerfasst: Sa 13.03.04 15:11 
Hi,

das könnte schwer werden, da das per OLE passiert und die ( die OLE ? ) integraler Bestandteil der VCL ist.
Mike_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Sa 13.03.04 16:42 
Das habe ich auch bemerkt, als ich es über OLE versucht habe :)

Aber für Excel gibt's ne Möglichkeit, so zu sagen die Daten direkt zu schreiben, ohne Excel überhaupt auf zu rufen.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
unit msExcel;

interface

uses
  Classes;


procedure XlsBeginStream(XlsStream: TStream; const BuildNumber: Word);
procedure XlsEndStream(XlsStream: TStream);
procedure XlsWriteCellRk(XlsStream: TStream; const ACol, ARow: Word;
  const AValue: Integer);
procedure XlsWriteCellNumber(XlsStream: TStream; const ACol, ARow: Word;
  const AValue: Double);
procedure XlsWriteCellLabel(XlsStream: TStream; const ACol, ARow: Word;
  const AValue: string);


implementation

var
  CXlsBof: array[0..5] of Word = ($809, 8, 00, $10, 0, 0);
  CXlsEof: array[0..1] of Word = ($0A, 00);
  CXlsLabel: array[0..5] of Word = ($204, 0, 0, 0, 0, 0);
  CXlsNumber: array[0..4] of Word = ($203, 14, 0, 0, 0);
  CXlsRk: array[0..4] of Word = ($27E, 10, 0, 0, 0);

procedure XlsBeginStream(XlsStream: TStream; const BuildNumber: Word);
begin 
  CXlsBof[4] := BuildNumber;
  XlsStream.WriteBuffer(CXlsBof, SizeOf(CXlsBof));
end;

procedure XlsEndStream(XlsStream: TStream);
begin 
  XlsStream.WriteBuffer(CXlsEof, SizeOf(CXlsEof)); 
end; 

procedure XlsWriteCellRk(XlsStream: TStream; const ACol, ARow: Word;
  const AValue: Integer);
var
  V: Integer; 
begin 
  CXlsRk[2] := ARow;
  CXlsRk[3] := ACol; 
  XlsStream.WriteBuffer(CXlsRk, SizeOf(CXlsRk)); 
  V := (AValue shl 2) or 2; 
  XlsStream.WriteBuffer(V, 4); 
end; 

procedure XlsWriteCellNumber(XlsStream: TStream; const ACol, ARow: Word;
  const AValue: Double);
begin
  CXlsNumber[2] := ARow; 
  CXlsNumber[3] := ACol; 
  XlsStream.WriteBuffer(CXlsNumber, SizeOf(CXlsNumber)); 
  XlsStream.WriteBuffer(AValue, 8); 
end; 

procedure XlsWriteCellLabel(XlsStream: TStream; const ACol, ARow: Word;
  const AValue: string);
var
  L: Word; 
begin 
  L := Length(AValue); 
  CXlsLabel[1] := 8 + L; 
  CXlsLabel[2] := ARow; 
  CXlsLabel[3] := ACol; 
  CXlsLabel[5] := L; 
  XlsStream.WriteBuffer(CXlsLabel, SizeOf(CXlsLabel)); 
  XlsStream.WriteBuffer(Pointer(AValue)^, L); 
end; 


end.


sowas bräuchte ich jetzt für Word, wenn's das gibt.

Greetz
Mike

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
Alfons-G
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 307

Win XP Prof, Linux, Win 7
D5 Prof, D7 Architect, D2005 Architect, D2007 Architect
BeitragVerfasst: So 14.03.04 00:13 
In der Dokumentation von OpenOffice ist auch das Dateiformat von MS Word beschrieben. Zumindest zum Erstellen einfacher Wod-Dokumente sollten die Informationen dort ausreichen.

8)

_________________
Alfons Grünewald