Microsoft Word 9.0 Object Library

I try to use 'Microsoft Word 9.0 Object Library' in Navisoin for make report in MSWord format.
Target: Open MSWord, Create new document and transfer some text in it.
Problem is here:
When I use class "selection" (array variable SEL as "'Microsoft Word 9.0 Object Library'.Selection"). Navision can't do CREATE(SEL). If I try "SEL:=doc.select" error is "Assignment is not allowed for this variable".


  • Below is my post, but please ignore it as I didn't realise it was in the N3 section, I have never seen N3 so I can't help.

    ____________________________________________

    Sorry Yarovyy, it might be the translation but why are you using an Array.

    It appears from the Text that you have created a Variable called Sel, Type=Array, Using the Microsoft Word Object Library Object Selection.

    But if I look at the error message you show it seems to say SEL is not the same Variable Type as the Method Select in the Object Selection wants.

    If you post again with a bit more information including the Variables you have used and the Exact code I will see if I can help. But Im away for 5 days as of half an hour!

    But basically it looks like your trying to assign one type of variable to another, navision does not like this.




    Edited by - tonyh on 2002 Mar 28 17:37:22
  • Problem is gone.
    variable SEL is Automation type, of course.
    And I could initialize it by string:
    SEL:=wdApplication.Selection;
    Sorry for disturb.

Related