Skip to main content

[Migrated content. Thread originally posted on 17 August 2005]

greetings,

i wrote a program to add contacts to outlook.
I works fine on nearly all installations.
But if a ExcangeServer is involved, i get an automatation error.
I figured out the problem with a VB program.

I only needed to change this line:
Set AppOutlook = CreateObject "Outlook.Application")

to this one:

Set AppOutlook = CreateObject "Outlook.Application", "Localhost")

The only change is the "Localhost" and works fine.


And now the problem:
I use this line to start outlook in Acu:

create application of Outlook handle in outlook-handle

How to add the "localhost"?

The outlook.def look like this:
* Application
CLASS @Application
CLSID, 0006F03A-0000-0000-C000-000000000046
NAME, "Application"
DEFAULT-INTERFACE, "_Application"
DEFAULT-SOURCE, "ApplicationEvents"
* Application
PROPERTY-GET, 61440, @Application
RETURNING "_Application*", TYPE 9

Not really much "Servername" options/parameters.
Has anyone an idea how to start an activeX-outlook with "Servername" = "Localhost"?

[Migrated content. Thread originally posted on 17 August 2005]

greetings,

i wrote a program to add contacts to outlook.
I works fine on nearly all installations.
But if a ExcangeServer is involved, i get an automatation error.
I figured out the problem with a VB program.

I only needed to change this line:
Set AppOutlook = CreateObject "Outlook.Application")

to this one:

Set AppOutlook = CreateObject "Outlook.Application", "Localhost")

The only change is the "Localhost" and works fine.


And now the problem:
I use this line to start outlook in Acu:

create application of Outlook handle in outlook-handle

How to add the "localhost"?

The outlook.def look like this:
* Application
CLASS @Application
CLSID, 0006F03A-0000-0000-C000-000000000046
NAME, "Application"
DEFAULT-INTERFACE, "_Application"
DEFAULT-SOURCE, "ApplicationEvents"
* Application
PROPERTY-GET, 61440, @Application
RETURNING "_Application*", TYPE 9

Not really much "Servername" options/parameters.
Has anyone an idea how to start an activeX-outlook with "Servername" = "Localhost"?
I can understand you are confused. But in this case, the definition file cannot help you. CreateObject has two parameters, the first, which is the object to create is familiar enough. The second one is more rare to use, and that is if you want to create the COM object as DCOM, e.g. Distributed COM (executing on another machine).

This would be accomplished with ACUCOBOL-GT by:


CREATE Application OF Outlook SERVER-NAME "Localhost" GIVING myapphandle.


However, as long as this both for ACUCOBOL-GT and vb is an optional parameter, it means you do not have to specify it. When you also know that Localhost is the machine you execute on, and that is the machine being used when you do not specify the host, you don't have to state it. With other words, this is doing the same as the one above:


CREATE Application OF Outlook GIVING myapphandle.


Hope this helps.

[Migrated content. Thread originally posted on 17 August 2005]

greetings,

i wrote a program to add contacts to outlook.
I works fine on nearly all installations.
But if a ExcangeServer is involved, i get an automatation error.
I figured out the problem with a VB program.

I only needed to change this line:
Set AppOutlook = CreateObject "Outlook.Application")

to this one:

Set AppOutlook = CreateObject "Outlook.Application", "Localhost")

The only change is the "Localhost" and works fine.


And now the problem:
I use this line to start outlook in Acu:

create application of Outlook handle in outlook-handle

How to add the "localhost"?

The outlook.def look like this:
* Application
CLASS @Application
CLSID, 0006F03A-0000-0000-C000-000000000046
NAME, "Application"
DEFAULT-INTERFACE, "_Application"
DEFAULT-SOURCE, "ApplicationEvents"
* Application
PROPERTY-GET, 61440, @Application
RETURNING "_Application*", TYPE 9

Not really much "Servername" options/parameters.
Has anyone an idea how to start an activeX-outlook with "Servername" = "Localhost"?
Gisle,

Could I apply to same DCOM logic to other applications or do that applications have to have code to support it? For example, could I do this for Word or Excel?

CREATE Application OF Word SERVER-NAME "servername" GIVING myapphandle.

Rob

[Migrated content. Thread originally posted on 17 August 2005]

greetings,

i wrote a program to add contacts to outlook.
I works fine on nearly all installations.
But if a ExcangeServer is involved, i get an automatation error.
I figured out the problem with a VB program.

I only needed to change this line:
Set AppOutlook = CreateObject "Outlook.Application")

to this one:

Set AppOutlook = CreateObject "Outlook.Application", "Localhost")

The only change is the "Localhost" and works fine.


And now the problem:
I use this line to start outlook in Acu:

create application of Outlook handle in outlook-handle

How to add the "localhost"?

The outlook.def look like this:
* Application
CLASS @Application
CLSID, 0006F03A-0000-0000-C000-000000000046
NAME, "Application"
DEFAULT-INTERFACE, "_Application"
DEFAULT-SOURCE, "ApplicationEvents"
* Application
PROPERTY-GET, 61440, @Application
RETURNING "_Application*", TYPE 9

Not really much "Servername" options/parameters.
Has anyone an idea how to start an activeX-outlook with "Servername" = "Localhost"?
You can do this for all COM objects.
The catch you have to look out for is that A) the COM object has been installed on the remote machine, B) the COM proxy is installed on your local machine (normally always on newer Windows), C) that the COM object is sharing on the server and finally D) that the remote user (you on your client machine) has the sufficient privileges to execute on the server which the object actually is executing on.

I demonstrated this once using ACUCOBOL-GT Automation server, I then had a Delphi application on machine A, which executed an ACUCOBOL-GT application on machine B using DCOM.

Worked like a champ. (of course :-) )

[Migrated content. Thread originally posted on 17 August 2005]

greetings,

i wrote a program to add contacts to outlook.
I works fine on nearly all installations.
But if a ExcangeServer is involved, i get an automatation error.
I figured out the problem with a VB program.

I only needed to change this line:
Set AppOutlook = CreateObject "Outlook.Application")

to this one:

Set AppOutlook = CreateObject "Outlook.Application", "Localhost")

The only change is the "Localhost" and works fine.


And now the problem:
I use this line to start outlook in Acu:

create application of Outlook handle in outlook-handle

How to add the "localhost"?

The outlook.def look like this:
* Application
CLASS @Application
CLSID, 0006F03A-0000-0000-C000-000000000046
NAME, "Application"
DEFAULT-INTERFACE, "_Application"
DEFAULT-SOURCE, "ApplicationEvents"
* Application
PROPERTY-GET, 61440, @Application
RETURNING "_Application*", TYPE 9

Not really much "Servername" options/parameters.
Has anyone an idea how to start an activeX-outlook with "Servername" = "Localhost"?
Thanks for the input, Gisle. That will be very valuable for me in the near future.

Rob

[Migrated content. Thread originally posted on 17 August 2005]

greetings,

i wrote a program to add contacts to outlook.
I works fine on nearly all installations.
But if a ExcangeServer is involved, i get an automatation error.
I figured out the problem with a VB program.

I only needed to change this line:
Set AppOutlook = CreateObject "Outlook.Application")

to this one:

Set AppOutlook = CreateObject "Outlook.Application", "Localhost")

The only change is the "Localhost" and works fine.


And now the problem:
I use this line to start outlook in Acu:

create application of Outlook handle in outlook-handle

How to add the "localhost"?

The outlook.def look like this:
* Application
CLASS @Application
CLSID, 0006F03A-0000-0000-C000-000000000046
NAME, "Application"
DEFAULT-INTERFACE, "_Application"
DEFAULT-SOURCE, "ApplicationEvents"
* Application
PROPERTY-GET, 61440, @Application
RETURNING "_Application*", TYPE 9

Not really much "Servername" options/parameters.
Has anyone an idea how to start an activeX-outlook with "Servername" = "Localhost"?
@Gisle

i just tried it on the customer server ..

But with no effect.

by the way: His installation uses a domain-server with server based profiles. Small business server.

The "Server-Name" seems to be ignored. There is no change in the effect.

I'm wondering, why the change has an effect on the VB-Program, but not on the AcuCorp Program.

Is there another way to create the outlook instance?
Or can it be a bug and should be reported to the support?

[Migrated content. Thread originally posted on 17 August 2005]

greetings,

i wrote a program to add contacts to outlook.
I works fine on nearly all installations.
But if a ExcangeServer is involved, i get an automatation error.
I figured out the problem with a VB program.

I only needed to change this line:
Set AppOutlook = CreateObject "Outlook.Application")

to this one:

Set AppOutlook = CreateObject "Outlook.Application", "Localhost")

The only change is the "Localhost" and works fine.


And now the problem:
I use this line to start outlook in Acu:

create application of Outlook handle in outlook-handle

How to add the "localhost"?

The outlook.def look like this:
* Application
CLASS @Application
CLSID, 0006F03A-0000-0000-C000-000000000046
NAME, "Application"
DEFAULT-INTERFACE, "_Application"
DEFAULT-SOURCE, "ApplicationEvents"
* Application
PROPERTY-GET, 61440, @Application
RETURNING "_Application*", TYPE 9

Not really much "Servername" options/parameters.
Has anyone an idea how to start an activeX-outlook with "Servername" = "Localhost"?
This is odd. I figure we will need an example. Have you checked the software event log to see if Outlook reports anything?