Einzelnen Beitrag anzeigen

Stoned-6

Registriert seit: 27. Nov 2007
Ort: Mainz
4 Beiträge
 
#6

Re: VBScript in Delphi einbinden oder umwandeln

  Alt 23. Dez 2007, 20:37
Da ich nicht der crack bin hab ich das erstmal soweit auskommentiert, das der compiler mir das ganze überhaupt übersetzt. funktioniert mit dem compileren aber das programm dank meiner unwissenheit nicht.
hab mal wieder zu viel weggelassen.

ich hoffe du kannst mir helfen.


---cut-----


unit Unit1;

interface

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

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

var
Form1: TForm1;


Const sDataFolder = 'D:\apps\Brother bPAC SDK\Templates\';


implementation

{$R *.dfm}


{
'************************************************* *******
' Get file path from the list
'************************************************* *******
Public Function GetFilePath() As String
Dim strPath As String
Dim nIndex As Integer
nIndex = cbTemplate.ListIndex
If (nIndex = 0) Then
strPath = 'NamePlate1.LBL'
Else
strPath = 'NamePlate2.LBL'
End If
GetFilePath = sDataFolder & strPath
End Function
}

//'************************************************* *******
//' Open and Print(Export) a spcified file.
//'************************************************* *******



procedure TForm1.Button1Click(Sender: TObject);

var strPath, strExport :string;
ObjDoc : OleVariant;
nindex : integer;
begin

strExport := 'BcdItem.lbl';

// Dim ObjDoc As BrssCom.Document

ObjDoc := CreateOleObject('BrssCom.Document');
nIndex := ObjDoc.GetTextIndex('Company');
// ObjDoc.SetText nIndex, edPosition.Text;
nIndex := ObjDoc.GetTextIndex('Name');
// ObjDoc.SetText nIndex, edName.Text;
ObjDoc.Export(2, strExport, 180); // Export


// cbTemplate.ListIndex := 0;


end;

end.
  Mit Zitat antworten Zitat