Can u tell me how can i put a text into a specific part

Edu@rdoEdu@rdo Member Posts: 3
edited 2005-01-27 in Navision Attain
Hello,

I'm trying to Export e Report in Navision to a Word Document but I have dificult in pass the values with the function GoTo, can anyone give me an example how to do that.

Regards,

Edu@rdo

Comments

  • ArhontisArhontis Member Posts: 667
    Hello,

    I usually do something like:
      WordAF.ActiveDocument.Range.Words.Item(30).InsertAfter('something');
      WordAF.ActiveDocument.Range.Words.Item(40).InsertAfter('to ');
      WordAF.ActiveDocument.Range.Words.Item(50).InsertAfter('insert');
    
    or I have entered in the doc my marks and try to find and replace them like:
      a:='<EXPIRATION DATE>';
      IF WordAF.ActiveWindow.Selection.Find.Execute(a) THEN
          WordAF.ActiveWindow.Selection.TypeText:=FORMAT(SalesOrder."Service Contract Expire Date");
      END;
    

    Or in your case with the goto:
      a:=3;
      b:=1;
      c:=3;
      d:='';
      WordAF.ActiveWindow.Selection.GoTo(a,b,c,d);
    
    where a = goto line (and goto Page=1, goto section=2...), b=gotofirstfind, c=line number (or page number or ...). The a,b,c,d vars are Variants.
Sign In or Register to comment.