publishing a form in Outlook 2003

S

Susan G

I am new to forms in Outlook and am trying to change some
code. I did a publish of a form to a new name so that I
can have a "test" environment to work with. However when
I try to choose this new form it cannot find the objects.
What other steps do I need to take to make a completely
separate form that will work?
Please help!!
 
S

Sue Mosher [MVP]

What do you mean by "it cannot find the objects"? Where did you publish the form?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Susan G

It was a VbScript error of "Object required"
I did find 2-CurrentForm in the advanced property of
cycle on 2 of the forms and I changed that to 0-AllForms -
and then it ran ok and I could publish successfully and
it runs without error. But then when I go back into the
design form I see that it is set back to 2-CurrentForm
and sometimes I get the "Object required" error and
sometimes I don't.
The error comes right at the defining of the controls in
this piece of code:
Set pgReport = Item.GetInspector.ModifiedFormPages
Set label1 = pgReport("REPORT").Controls ("label1")

The one form is named REPORT. The error comes on the
second line. How can I get this to be more stable.
Sometimes it is OK and sometimes it isn't.
Thanks!
-----Original Message-----
What do you mean by "it cannot find the objects"? Where did you publish the form?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers


"Susan G" <[email protected]> wrote in
message news:[email protected]...
 
S

Sue Mosher [MVP]

I did find 2-CurrentForm in the advanced property of
cycle on 2 of the forms and I changed that to 0-AllForms -
and then it ran ok and I could publish successfully and
it runs without error.

I don't understand what you are referring to here.
The error comes right at the defining of the controls in
this piece of code:
Set pgReport = Item.GetInspector.ModifiedFormPages
Set label1 = pgReport("REPORT").Controls ("label1")

The one form is named REPORT. The error comes on the
second line. How can I get this to be more stable.

The syntax above is incorrect. Try:

Set pgReport = Item.GetInspector.ModifiedFormPages("REPORT")
Set label1 = pgReport.Controls ("label1")

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Susan G

I tried the new syntax and get the error "Microsoft
VBScript runtime error: Object Required:'pgReport'
The problem is that inadvertantly yesterday I must have
done something that made it not have this error but now
it has returned.
The original problem that made me even look at this code
is that when it runs the code with large amounts of data
it comes up with an error. Then when I go into debug it
shows the item equalling Nothing. This code works
perfectly fine on Outlook 2000, but in 2003 it dies out.
Are there settings in Outlook 2003 that I should be
looking at??
Please help - I am on a deadline and I have never touched
Outlook Forms before yesterday.
Also that part I was talking about the 2-CurrentForm -
that is when you choose Form from the Menu Bar and then
Advanced Properties... from the dropdown. cycle is one of
the advanced properties of the form.

Thanks
 
S

Susan G

I also noticed that when it does not work it comes up
with a box that says for me to select a folder. When it
runs correctly, it does not ask me that.
Any help would be appreciated.
thanks!!
-----Original Message-----
I tried the new syntax and get the error "Microsoft
VBScript runtime error: Object Required:'pgReport'
The problem is that inadvertantly yesterday I must have
done something that made it not have this error but now
it has returned.
The original problem that made me even look at this code
is that when it runs the code with large amounts of data
it comes up with an error. Then when I go into debug it
shows the item equalling Nothing. This code works
perfectly fine on Outlook 2000, but in 2003 it dies out.
Are there settings in Outlook 2003 that I should be
looking at??
Please help - I am on a deadline and I have never touched
Outlook Forms before yesterday.
Also that part I was talking about the 2-CurrentForm -
that is when you choose Form from the Menu Bar and then
Advanced Properties... from the dropdown. cycle is one of
the advanced properties of the form.

Thanks
-----Original Message-----
I did find 2-CurrentForm in the advanced property of
cycle on 2 of the forms and I changed that to 0- AllForms -
and then it ran ok and I could publish successfully and
it runs without error.

I don't understand what you are referring to here.
The error comes right at the defining of the controls in
this piece of code:
Set pgReport = Item.GetInspector.ModifiedFormPages
Set label1 = pgReport("REPORT").Controls ("label1")

The one form is named REPORT. The error comes on the
second line. How can I get this to be more stable.

The syntax above is incorrect. Try:

Set pgReport = Item.GetInspector.ModifiedFormPages ("REPORT")
Set label1 = pgReport.Controls ("label1")

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP]

That "object required" error would indicate that the page referred to in the statement

Set pgReport = Item.GetInspector.ModifiedFormPages("REPORT")

doesn't exist. Check for typos, e.g. an extraneous space after the page name on the tab.

Was there a particular reason why you changed the Cycle property for the page? Do you have frame or multipage controls on the page.

I don't understand what you mean by "large amounts of data." This is code running in an Outlook form, right? So it's only one data record at a time.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP]

How are you launching the form? Where did you publish it?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Susan G

I think that the problem is that this code loops and that
I need to set my items back to nothing to clear
everything out. It dies when I loop through alot of
records. My big problem is just running the code. when I
go to run the form from within design mode, I get a
Select Folder form pop up and when I select a folder it
bombs out (says that it cannot recognize objects). For a
little while yesterday, I had this problem but somehow
inadvertently got it pointed in the right direction and
it was working. Now today I am back to having the Select
Folder form and the error. I have a feeling that I am
just not pointing at the right folder and am not sure how
to get myself pointed there. Any help would be greatly
appreciated.
thanks
-----Original Message-----
That "object required" error would indicate that the
page referred to in the statement
Set pgReport = Item.GetInspector.ModifiedFormPages ("REPORT")

doesn't exist. Check for typos, e.g. an extraneous space
after the page name on the tab.
Was there a particular reason why you changed the Cycle
property for the page? Do you have frame or multipage
controls on the page.
I don't understand what you mean by "large amounts of
data." This is code running in an Outlook form, right? So
it's only one data record at a time.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



"Susan G" <[email protected]> wrote in
message news:[email protected]...
 
S

Sue Mosher [MVP]

What is this looping code?

The Select Form dialog will always pop up when you run a post form from design mode. Why aren't you running the published form?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Susan G

The code is like the following
For i = 1 To Afolder.Items.Count
Set cContact = AFolder.Items(i)
Set uUsers = cContact.UserProperties
Set uU = uUsers.Item("CompanyId")
Set uUse = cContact.Userproperties
Set uu1 = uUse.Item("txtRole")
(then code if the uu1.value equals a selected Role)
next

This all worked fine in Outlook 2000, but in 2003 it is
bombing out if it goes through alot of contacts. I am new
to this and co-workers said that I need to add the
following code right before the next:
Set cContact = nothing
Set uUsers = nothing
Set uU = nothing
Set uUse = nothing
Set uu1 = nothing

I did this and published it and that is where I get the
object required message - won't even let me open up the
form. This form before the change opened up fine with no
error. It only got an error when they clicked a button
that ran code to do a search of contacts (the above code)
This is driving me crazy. I am an Access programmer and
have never touched Outlook forms before a few days ago
and I am stuck with how to get this to work. Adding the
code that I did above and doing a publish should not
cause the object required message. And the fact that I
did get it working for a little yesterday makes me think
that one of my settings is wrong. Thanks for being
patient with me.
Sue
-----Original Message-----
What is this looping code?

The Select Form dialog will always pop up when you run a
post form from design mode. Why aren't you running the
published form?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers


"Susan G" <[email protected]> wrote in
message news:[email protected]...
 
S

Susan G

I opened up another custom form in the same folder in
design and the run form worked ok and did not ask for a
select folder. Also when I did have that window of time
when it was working, the run form from within design
worked fine and had no select folder.
-----Original Message-----
What is this looping code?

The Select Form dialog will always pop up when you run a
post form from design mode. Why aren't you running the
published form?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers


"Susan G" <[email protected]> wrote in
message news:[email protected]...
 
S

Sue Mosher [MVP]

Again, why are you running from design mode?

Susan G said:
I opened up another custom form in the same folder in
design and the run form worked ok and did not ask for a
select folder. Also when I did have that window of time
when it was working, the run form from within design
worked fine and had no select folder.

post form from design mode. Why aren't you running the
published form?
message news:[email protected]...
 
S

Susan G

I was just running from design mode to make sure the code
worked. Every time that it did not run in design, it did
not run after publish. I get the cannot find object error
when I publish and run it too. Another one with code
similar (except for the 5 lines I added which are under a
button they click) runs fine, but if I publish that to a
different name, the new one will not run. It is something
about my current setup that is messing this up, not the
code since I did actually get it to publish OK for a
little while yesterday (but that was before I put in the
new code which should not affect it opening up).
Any ideas?
-----Original Message-----
Again, why are you running from design mode?

"Susan G" <[email protected]> wrote in
message news:[email protected]...
 
S

Susan G

I sent off for your book but it will not come for a day
or 2. There is definitely something wrong with my
publish.
I now went to the Oracle Standard forms and started fresh
with a new form. I created my two custom forms and copied
and pasted all of the controls to the form. I also cut
and pasted all of the code into the new form. When I ran
it from design mode it started with no error...some of
the things (list box) did not look exactly the same, but
I did not get the "object required" error. So I published
it and it ran without the error. Then I went back in
under design mode - tried to run it from design mode and
got the "object required" error. Then I did a publish and
tried to run the live one and got an "object required"
error. Can you please give me some direction on where to
go from here??
-----Original Message-----
I was just running from design mode to make sure the code
worked. Every time that it did not run in design, it did
not run after publish. I get the cannot find object error
when I publish and run it too. Another one with code
similar (except for the 5 lines I added which are under a
button they click) runs fine, but if I publish that to a
different name, the new one will not run. It is something
about my current setup that is messing this up, not the
code since I did actually get it to publish OK for a
little while yesterday (but that was before I put in the
new code which should not affect it opening up).
Any ideas?
-----Original Message-----
Again, why are you running from design mode?

"Susan G" <[email protected]> wrote
in
message news:[email protected]...
 
S

Sue Mosher [MVP]

What are Oracle Standard forms? What statement is producing the "object required" error? It's hard to know how to fix an error without knowing what statement triggers it.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Susan G

I figured out what was going on. There is a setting on
the menu bar that is "show this page". I had 2 custom
pages in this form. When I created a new one, both were
checked on. When I publish and then open in design mode,
it takes the check off the second custom page (do not
know why since it was published with it checked on). To
get it to run, I have to make sure that both pages are
checked as "show this page" since opening in design mode
takes one off. Is there a setting I am missing that
unchecks this when I open it up?
-----Original Message-----
What are Oracle Standard forms? What statement is
producing the "object required" error? It's hard to know
how to fix an error without knowing what statement
triggers it.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers


"Susan G" <[email protected]> wrote in
message news:[email protected]...
 
S

Sue Mosher [MVP]

None that I know of, unless you have code running to hide a page.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 

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