I was updating a function form Navision 2.6 that uses Automation Objects to NAV 2013 with DotNet.
The functions opens a word document and fills aut the address fields. I just moved the functions from Automation
to dotnet Variable and filled aut the proper function with some minor changes.
NAV 2013 RTC opens the document, but when I try to select the fields in the word-document with the "item"-property
wdApp.ActiveDocument.Fields.Item(i).Result, I always get the error messsage "Item is not a property"
Does anybody know, how to change the code to be get working.
IF NOT ISSERVICETIER THEN BEGIN
CREATE(wdApp);
wdDoc := wdApp.Documents.AddOld(TempName);
wdApp.ActiveDocument.Fields.Update;
END;
Name := "Job Title" + ' ' + Name;
AdrFormat.ContactAddr(AdrInteressent,lContact);
AdrFormat.ContactAddr(AdrKontaktperson,pContactPerson);
FOR i := 1 TO 6 DO BEGIN
wdRange := wdApp.ActiveDocument.Fields.Item(i).Result;
wdRange.Text := AdrKontaktperson;
END;
wdApp.Visible := TRUE;
wdApp.ActiveDocument.Fields.Unlink;
0
Comments
Here's what I would try, although it's just a suggestion.
Replace:
with:
Something alone those lines...
- Reinhard
Any other solutions?