>Hi Everyone,
>
>We have a code in mail merge which runs successfully on version lower than Office 2003.
>
>If we use Office 2003, it has a problem.
>
>It will give an error message
>“Error Message: OLE IDispatch exception code 0 from Microsoft Word: Requested object is not available...”
>
>Below is our Visual Foxpro 8.0 code.
>====================================
>
>
>lcFileName = getfile("doc")
>
>PUBLIC goWordApp, goWordDoc
>goWordApp = createobject("Word.Application")
>goWordApp.Visible = .t.
>goWordApp.WindowState = 0
>goWordDoc = goWordApp.Documents.Open(lcFileName)
>
>with goWordDoc.MailMerge
> .Destination = 1
> .Execute
>endwith
>
>goWordDoc.Close(.f.)
>goWordApp.Quit(.f.)
>
>release goWordDoc, goWordApp
>
>
>
>
>
>
>
>Looks to me that there are changes on Word 2003 object implementation.
>The code that has the problem is in “.Destination = 1”
>
>Anybody know what changes shall we do so that we can run it on Word 2003?
>Also, what code shall we put so that it can support lower Office version #?
Shooting in dark w/o w2003. Destination = 1 is for printing, right ? Following that you seem to be releasing the word before it does the printing.
Cetin