Anonymous_User Absent Member.
Absent Member.
2484 views

re: need help to create document object

Hi there,

I am new to C3PO stuff and would anyone kindly give me a hand? I am trying
to create a Document object out of the Message object, but it always give
me error:
err.description= object required
err.number=438
err.helpcontext= 1000424

here is the actual code using VB
==========================================

Dim objSelectedMessages As Object
Dim objMessage as Object
Set objSelectedMessages = g_C3POManager.ClientState.SelectedMessages
Set objSelectedMessages = objSelectedMessages.Find("(DOCREFERENCE) AND
(<Document Status, STRING> CONTAINS NOT ""Final"")")

For Each objMessage In objSelectedMessages
DoSomething objMessage.Document
Next

==========================================

Everything works great before we upgrade to GroupWise 7(from ver. 6)...

Thanks for reading this post.

Sincerely,

Philip



Labels (1)
0 Likes
5 Replies
Anonymous_User Absent Member.
Absent Member.

re: need help to create document object

Did the same code work on the same mailbox? That is, are there documents
with the custom property called "Document Status" that don't contain the
word "FINAL"?

Can you tell where the "object required" error is coming in? It will be
helpful in pinpointing which line and code is giving the problem.


philipn@windingriver.ca (PCode2006) wrote in
news:rc_jg.1984$tN4.1942@prv-forum2.provo.novell.com:

> Hi there,
>
> I am new to C3PO stuff and would anyone kindly give me a hand? I am
> trying to create a Document object out of the Message object, but it
> always give me error:
> err.description= object required
> err.number=438
> err.helpcontext= 1000424
>
> here is the actual code using VB
> ==========================================
>
> Dim objSelectedMessages As Object
> Dim objMessage as Object
> Set objSelectedMessages =
> g_C3POManager.ClientState.SelectedMessages Set objSelectedMessages
> = objSelectedMessages.Find("(DOCREFERENCE) AND
> (<Document Status, STRING> CONTAINS NOT ""Final"")")
>
> For Each objMessage In objSelectedMessages
> DoSomething objMessage.Document
> Next
>
> ==========================================
>
> Everything works great before we upgrade to GroupWise 7(from ver.
> 6)...
>
> Thanks for reading this post.
>
> Sincerely,
>
> Philip
>
>
>
>




--
Regards,
Michael Risch
Developer SysOp
0 Likes
Anonymous_User Absent Member.
Absent Member.

re: need help to create document object

Philip,

I just tried to duplicate the problem. I first created a new custom field
definition called "Document Status". I assigned some documents to have the
word "Final" in this field, and some documents didn't have this word in this
field. I then ran your exact code except for your line that says
DoSomething. Instead, I used the line

Set MyDoc = objMessage.Document

I ran a C3PO using GW 6.5.6. Everything worked fine. I then ran a C3PO
using GW 7 SP1. Again everything worked fine. There were no errors, and
all the document objects were created correctly. So I cannot duplicate the
problem.

You didn't say what version of GW 7 you were using. GW 7 SP1 is suppose to
ship within the next couple of weeks - so I'd suggest that you upgrade to
that version and try again. Hopefully you will see the same successful
results that I did.

Regards,
Glade,
Novell Developer Services




0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: need help to create document object

Thanks Michael and Glade, I really appreciate the input.

I am sorry that I should have include the doSomthing method code, here it
is:

here is the actual code using VB
==========================================

private sub CheckDocFinalStatus()
Dim objSelectedMessages As Object
Dim objMessage as Object
Set objSelectedMessages =
g_C3POManager.ClientState.SelectedMessages Set objSelectedMessages
= objSelectedMessages.Find("(DOCREFERENCE) AND
(<Document Status, STRING> CONTAINS NOT ""Final"")")

For Each objMessage In objSelectedMessages
DoSomething objMessage.Document
Next
end sub

private sub doSomething(byval ADocument as object) <-- error occurs here
If ADocument is nothing then
else
....
end if
end sub
==========================================

The error occurs as soon as I called doSomething Method, it won't allow me
to create the document object at all. Seems to be missing a reference in
my development environment because when I looked at the vb6 intellisense,
there is no child object for the message.document.

I know this is silly but is message.document object part of the GW Object
API, right? I think I am missing something...

And I will definitely install the GW7 SP1 as soon as possible and keep you
guys update how it goes.

Really appreciated.


Thanks,

Philip







PCode2006 wrote:

> Hi there,


> I am new to C3PO stuff and would anyone kindly give me a hand? I am trying
> to create a Document object out of the Message object, but it always give
> me error:
> err.description= object required
> err.number=438
> err.helpcontext= 1000424


> here is the actual code using VB
> ==========================================


> Dim objSelectedMessages As Object
> Dim objMessage as Object
> Set objSelectedMessages = g_C3POManager.ClientState.SelectedMessages
> Set objSelectedMessages = objSelectedMessages.Find("(DOCREFERENCE) AND
> (<Document Status, STRING> CONTAINS NOT ""Final"")")


> For Each objMessage In objSelectedMessages
> DoSomething objMessage.Document
> Next


> ==========================================


> Everything works great before we upgrade to GroupWise 7(from ver. 6)...


> Thanks for reading this post.


> Sincerely,


> Philip



0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: need help to create document object

Philip,

I just tried your code again with your call to doSomething. I tried it both
in GW 6.5.6 and GW 7 SP1. It worked fine in both GroupWise versions.

The Message object doesn't have a property called Document, but the
DocumentReference object does. The DocumentReference object is a subtype of
the Message object. Since your "Find" operation found DocumentReference
objects, the Message.Document line should be finding the
DocumentReference.Document value of each message in your collection. When I
run the code, this appears to be working correctly.

Sorry I can't duplicate your problem.

Glade,
Novell Developer Services

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: need help to create document object

Hi Glade,

We just applied SP1 for version 7 and everything works perfectly! Thanks
for the effort and thanks again for everything, really appreciated!

Thanks,

Philip



Glade Monson wrote:

> Philip,


> I just tried your code again with your call to doSomething. I tried it both
> in GW 6.5.6 and GW 7 SP1. It worked fine in both GroupWise versions.


> The Message object doesn't have a property called Document, but the
> DocumentReference object does. The DocumentReference object is a subtype of
> the Message object. Since your "Find" operation found DocumentReference
> objects, the Message.Document line should be finding the
> DocumentReference.Document value of each message in your collection. When I
> run the code, this appears to be working correctly.


> Sorry I can't duplicate your problem.


> Glade,
> Novell Developer Services



0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.