Outlook script works in 2000 but not 2003

A

adammfellows

Hi

We use a custom for that has worked with no problems for many months.
However, some users have now moved on to using Outlook 2003. These
users get an error message on a particular line of code when opening
the form.

It is an Object Required error and is on the line:

set HRcts = ins.modifiedformpages("HR").controls


As I mentioned, this works correctly in Outlook 2000, but not 2003.
Interestingly, there are other "set" commands for other pages in the
form that do not cause errors either in 2000 or 2003. Here is the
code up to that point for reference:

dim ins
dim cts
dim wsh
dim xls
dim xl2
dim HRcts
dim LDcts
dim MOBcts
dim OTHcts
dim XLAppFx


Function Item_Open()

set ins = item.getinspector
ins.hideformpage("HR")
ins.hideformpage("Job Desc / Justification")

set cts = ins.modifiedformpages("Message").controls
set xls = GetObject("\\libsppfps002.uk.liberata.net\procurement
\ProcurementFormData.xls")
set wsh = xls.worksheets("BusArea")
for each r in wsh.usedrange.rows
cts("cmbBusinessArea").additem r.range("A1").value
next ' r
cts("cmbBusinessArea").listindex = cts("txtBusinessArea").value
cts("cmbBusinessCentre").listindex = cts("txtBusinessCentre").value
cts("cmbOperatingUnit").listindex = cts("txtOperatingUnit").value

ins.SetCurrentFormPage("Message")


set xls = GetObject("\\libsppfps002.uk.liberata.net\procurement
\ProcurementFormData.xls")

set wsh = xls.worksheets("Clients")
for each r2 in wsh.usedrange.rows
cts("cmbRecharge3").additem r2.range("A1").value
next ' r2

cts("cmbRecharge3").listindex = cts("txtRecharge").value

ins.SetCurrentFormPage("Message")

set HRcts = ins.modifiedformpages("HR").controls


I would be very grateful for any help on this.

Regards

Adam
 
S

Sue Mosher [MVP-Outlook]

The error suggests that the HR page is not visible at that point in the code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top