Passing parameter to OutLook form.

D

David Lao

Hi,

I have a Perl script which invokes by other application. When the script is
executed,
I have export several environment variables. Within the same process, I
launch
my template.oft file, the environment variables were export from Perl were
not
accessable inside template.oft.

How can I pass the parameters to Outlook template.oft file ?

Currently, my work around the problem, I wrote the environment to a file and
then I open to read from inside template.oft. Thank for your helps.


David Lao
 
S

Sue Mosher [MVP-Outlook]

Set properties in the Outlook item, either built-in properties like Mileage
or BillingInformation or custom properties you add while designing the form.
 
D

David Lao

Hi Sue,

When user invokes the template.opt, the first event I got is "item_open".
Within the item_open function, I tried the code as follows:

set WshShell = CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("PROCESS")
EOSLoc = WshSysEnv("EOSLOCATION")

But EOSLoc is empty ("").
Set properties in the Outlook item, either built-in properties like Mileage
or BillingInformation or custom properties you add while designing the form.

With your suggestion, I dont't quite understand. Where can I set the
properties
of an item in Outlook ?

Thank you.

David Lao
 
S

Sue Mosher [MVP-Outlook]

That's not what I had in mind at all. You wrote that you are launching the
..oft file within the same process. If so, you can set an Outlook property on
the resulting item. In VB languages it would look like:

Set objItem = objNamespace.CreateItemFromTemplate(<path to .oft file>)
objItem.Mileage = whatever

If the environment variable values aren't "sticking," that's not an Outlook
issue.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



David Lao said:
Hi Sue,

When user invokes the template.opt, the first event I got is "item_open".
Within the item_open function, I tried the code as follows:

set WshShell = CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("PROCESS")
EOSLoc = WshSysEnv("EOSLOCATION")

But EOSLoc is empty ("").


With your suggestion, I dont't quite understand. Where can I set the
properties
of an item in Outlook ?
 
Top