/ Forums / Advansys Formativ / Creating Solutions with Formativ / Creating Mail with an Documentreference

  • Creator
    Topic
  • #4128
    Menard
    Participant

    How can I create a Mail with an Documentreferende attached.
    When I use the Folders.messages function it retrieves only the mails not the Documentreferences

    I use the following code

    Set newdoc = lib.Documents.AddEx(“c:ftpform.xls”, , Folder_Best)

    Set Folder_Best = acc.AllFolders.ItemByName
    For Each Message In Folder_Best.Messages
    If Message.ClassName
    = “GW.MESSAGE.DOCUMENTREFERENCE” Then
    ‘Vergleiche Nummer
    End If
    Next

  • Author
    Replies
  • #7205
    Support 1a
    Participant

    Thank you for your question above. A Document object (i.e. a document added to a library) and a document reference are two distinct objects. Given a document object, you need to create a document reference and associate with with the document object. Once you have created a document reference, you can attach it to a message as you would any other message object.

    Assuming you add a document to a library and obtain a reference to the Document object like this:

    set oDocument = iDocumentLibrary.Documents.Add(iAttachment, oDocumentType)

    You then need to create a DocumentReference object in some folder and associate it with the document like this:

    docref = GroupWise.Account.DocumentsFolder.Messages.Add("GW.MESSAGE.DOCUMENTREFERENCE", oDocument, fgwCurrent)

    ‘docref’ now refers to the DocumentReference object (in this case stored in the users Documents folder). You could then add this as an attachment to a message.

    I hope this helps.

    Regards,

    Advansys Support

    #7208
    lp_irovetz
    Participant

    Hi Advansys team

    Your solution work fine since GW 7.0.3

    I Try to switch to GW 8.0.0 => Bug

    Here is my code

    path = “C:somefile.txt”
    set DocNew = MyLibrary.documents.Add(Path,”Document”)

    Set MailObjRef = MyAccount.DocumentsFolder.Messages.Add(“GW.MESSAGE.DOCUMENTREFERENCE”, DocNew, 1)

    Any idea or Novell reporting ?

    Thanks for your help

    L.P. Irovetz
    Arcane GroupWare

    #7206
    Support 1
    Participant

    Thanks for reporting this problem.

    >I Try to switch to GW 8.0.0 => Bug

    Do you get an error message with GroupWise 8.0.0? If so, what is the message text?

    We recommend using the latest update to any major version of GroupWise. For version 8.0 the latest update is 8.0.1, January 8 2010.

    Regards,
    Advansys Support

    #7203
    lp_irovetz
    Participant

    Sorry for French -> English translation of the mesage error

    >>
    Messages.Object
    Unknown error line …
    >>

    I’d tested in these environnements

    GW 7.0.3 + Fv 2.0.1 = OK

    GW 8.0.0 + Fv 2.0.1 = Error
    GW 8.0.1 + Fv 2.0.1 = Error
    GW 8.0.1 + Fv 2.0.2 Beta1 = Error

    Any idea ?

    L.P. Irovetz
    Arcane GroupWare

    #7210
    lp_irovetz
    Participant

    A clue

    The groupwise API documentation note another syntax whithout notice the classe name, assume that Document reference is used

    Set MailObjRef = MyAccount.DocumentsFolder.Messages.Add(“GW.MESSAGE.DOCUMENTREFERENCE”, DocNew, 1)
    could be
    Set MailObjRef = MyAccount.DocumentsFolder.Messages.Add(DocNew)

    but in this case we have the error “Class does not support Automation”

    Perhaps, Novell has changed the object or the methods to create it
    no problem, but now .. how to create a document reference ??

    Regards

    LP Irovetz
    Arcane GroupWare

    #7204
    Support 3
    Participant

    Looks like Messages.Add() method not working when you provide “GW.MESSAGE.DOCUMENTREFERENCE” as class name.

    Good to see your post in Novell Object API forum. Keep us update, if you find any resolution to the post.

    Novell docs says “If ClassName is omitted, a document reference (GW.MESSAGE.DOCUMENTREFERENCE) is assumed.”. Based on it, following code should work where class name not provided.

      
    Set MailObjRef = MyAccount.DocumentsFolder.Messages.Add("", DocNew, fgwCurrent)
    

    Hope this helps.

    Regards,
    Advansys Support

    #7209
    lp_irovetz
    Participant

    Sorry,

    No error whith this syntax but … not working Mad

    if you place after : Set MailObjRef = MyAccount.DocumentsFolder.Messages.Add(“”, DocNew, fgwCurrent)

    msgbox “MailObjRef : ” & MailObjRef.Classname

    In GW7 => MailObjRef.Classname = GW.MESSAGE.DOCUMENTREFERENCE
    and you can attached MailObjRef in a message

    In GW8 => MailObjRef.Classname = GW.MESSAGE.MAIL
    and you can’t attached MailObjRef in a message

    Could you tell it to Novell to help us
    I was pleasd to see Novell working on libraries (Speeder Query, Document conversion) but i need this fonction working to switch to GW8, or the new syntax Wink

    Thanks for your help

    LP Irovetz
    Arcane GroupWare

    #7207
    Support 3
    Participant

    As Preston Stephenson stated in your Novell forum post that Novell will investigate the issue.

    We will wait to see the results of the investigation.

    Regards,
    Advansys Support

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.