Dim Account Set Account = CreateObject("EmailExport.Account") Account.SomeMethod SomeParameters Account.SomeProperty = SomeValue
You can also use CreateObject method method of Server object (ASP) to put the Account object to page scope or CreateObject method of WScript object in WSH.
You can also put the object to Application or Session scope using <object ...> tag in global.asa
<object runat="server" scope="application" id="Account" progid="EmailExport.Account"> </object>
Please use ActivexObject object in JScript/JavaScript to create Account object:
var Account; Account = new ActiveXObject("EmailExport.Account"); Account.SomeMethod(SomeParameters) Account.SomeProperty = SomeValue ...
VBA 5/6: You can reference the library using menu Project -> References
-> select 'Email Account Export library' in the listbox (or Project ->
References -> Browse -> select EmailEx.DLL file).
MSAccess, Word, Excel: Tools -> Macro -> Visual Basic Editor, then Tools
-> References
Then you can write:
Dim Account As New EmailExport.Account Account.SomeMethod SomeParameters Account.SomeProperty = SomeValue ...or
Dim Account As EmailExport.Account ... Set Account = New EmailExport.Account Account.SomeMethod SomeParameters Account.SomeProperty = SomeValue ...You can use CreateObject function also, of course:
Dim Account As EmailExport.Account ... Set Account = CreateObject("EmailExport.Account") Account.SomeMethod SomeParameters Account.SomeProperty = SomeValue ...
You can reference the library using menu Project -> Add reference -> COM tab -> select 'Email Account Export library' in the listbox -> click Select. Then you can write (C#, J#):
//create a new Account objector (VBA)
EmailExport.Account Account = new EmailExport.AccountClass();
Account.set_String("Some text value");
String SQL;
SQL = "Insert Into Table (BinaryColumn) values (0x" + Account.get_HexString() + ")"; ...
Dim Account As New EmailExport.Account Account.SomeMethod(SomeParameters) Account.SomeProperty = SomeValue
DECLARE @Account INT, @OLEResult INT EXECUTE @OLEResult = sp_OACreate 'EmailExport.Account', @Account OUT IF @OLEResult <> 0 PRINT 'Error create component Account' --Set a property of Account. EXECUTE @OLEResult = sp_OASetProperty @Account, 'PropertyName', @SomeSQLValue IF @OLEResult <> 0 PRINT 'PropertyName set problem' --Get a value of a property of Account. EXECUTE @OLEResult = sp_OAGetProperty @Account, 'PropertyName', @SomeSQLValue OUTPUT IF @OLEResult <> 0 PRINT 'PropertyName get problem' --Call some method of Account. EXEC @OLEResult = sp_OAMethod @Account, 'MethodName', @ReturnValue OUTPUT, @parameter1, @parameter2
© 1996 - 2009 Antonin Foller, Motobit Software | About, Contacts | e-mail: info@pstruh.cz