Problems with running Word through OLE under Domino.Doc

Discussion in 'Lotus Notes Administration' started by Jesper Hostrup Hansen, Jul 14, 2004.

  1. Hi there,

    We have an application doing Word mail merge through an OLE-object.
    Though the vba script is quite somple, we have experienced some
    problems for those of our customers who are running Domino.Doc in
    their environment. The application cannot close the template file
    (Domino.Doc forces a save dialog to appear, even though I am trying to
    close without saving). This is the PowerBuilder code:

    loo_word_merger.Documents.open(as_stdletter[ll_count],0,1,0,"","",0,"","",0)//,0,1)
    //("ole.doc")
    loo_ActiveDocument = loo_word_merger.ActiveDocument
    loo_ActiveDocument.MailMerge.MainDocumentType = 0 //wdFormLetters
    loo_ActiveDocument.MailMerge.OpenDataSource
    (as_datafile[ll_count],0,0,0,1,0,"","",0,"","","","","")

    loo_ActiveDocument.MailMerge.Destination = 0 // wdSendToNewDocument
    loo_ActiveDocument.MailMerge.MailAsAttachment = 0
    loo_ActiveDocument.MailMerge.MailAddressFieldName = ""
    loo_ActiveDocument.MailMerge.MailSubject = ""
    loo_ActiveDocument.MailMerge.SuppressBlankLines = 1 //True

    loo_ActiveDocument.MailMerge.DataSource.FirstRecord = 1
    //wdDefaultFirstRecord
    loo_ActiveDocument.MailMerge.DataSource.LastRecord = -16
    //wdDefaultLastRecord

    loo_word_merger.visible = true
    loo_ActiveDocument.MailMerge.Execute // (1)
    loo_word_merger.visible = true
    loo_ActiveDocument.Close (0) // THIS STATEMENT FAILS


    The problem seems to appear when the user is running Word 2002 or 2003
    under Windows XP. It goas away if the Application Preferences under
    Domino.Doc settings is set to use ODMA Dialogs instead of Domino.Doc
    Office Dialogs.

    Can anyone suggest a code change to the OLE object - or any other good
    advice about OLE and Domino.Doc.

    Regards,
    Jesper Hostrup Hansen
    Maersk Data
     
    Jesper Hostrup Hansen, Jul 14, 2004
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.