can any body give me any code, so that i could throw (generate)
navision report in ms-word.
can any body show me how i can use coding for "ms office-word automation" in navision.
i have allready used following coding, but it is showing error.
Name DataType Subtype Length
wrdApp Automation 'Microsoft Word 11.0 Object Library'.Application
wrdDoc Automation 'Microsoft Word 11.0 Object Library'.Document
wrdRange Automation 'Microsoft Word 11.0 Object Library'.Range
Companyinfo.FIND;
userinfo.GET(USERID);
CREATE(wrdApp);
TemplateName:='c:\template.doc';
wrdDoc:=wrdApp.Documents.Add(TemplateName);
wrdApp.ActiveDocument.Fields.Update;
wrdRange:=wrdApp.ActiveDocument.Fields.Item(1).Result;
wrdRange.Text:=USERID;
wrdRange.Bold:=1;
wrdApp.Visible:=TRUE;
wrdApp.ActiveDocument.Fields.Unlink;
when i used above coding i found following error:
"The call to member item failed.the requested member of the collection does not exist."
and the debugger stops at the below given line.Pls give me any solution.thanks.
wrdRange:=wrdApp.ActiveDocument.Fields.Item(1).Result;
regards
vijay tiwari.
0
Comments
Here's a sample of how to export nav VENDOR data into word.
Name DataType Subtype Length
wdApp Automation 'Microsoft Word 11.0 Object Library'.Application
wdDoc Automation 'Microsoft Word 11.0 Object Library'.Document
wdRange Automation 'Microsoft Word 11.0 Object Library'.Range
TemplateName Text 250
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://savatage99.googlepages.com/WordA ... romADG.pdf
http://www.BiloBeauty.com
http://www.autismspeaks.org
I get "word was unable to create this document. It may be corrupt.
Try one or more of the following:
* open and repair the file.
* open the file with the text recovery converter.
I have tried all this has anyone else experienced this problem and been able to get around it?
Any help would be appreciated since I am still at home plate on this!
It is obvious that it is not finding the file but I dont know why? All looks correct I have tried both local and network directories.
I FINALLY GOT IT TO WORK BY RENAMING THE FILE TO FILNAME.DOC not .DOT I dont know why the .DOT (Document template did not work)!
A Computer Consulting
www.masellinux.com
Ok first you followed the ADG steps - correct?
Does You Automation variable look like what I posted Below?
Does your PC have Word Installed?
Did you save your Word Doc as a Template .DOT not .DOC?
How did the Template creation go for you?
http://www.BiloBeauty.com
http://www.autismspeaks.org
TemplateName:='c:\"YourWordTemplateNameHere".dot';
perhaps your code calls for DOC
http://www.BiloBeauty.com
http://www.autismspeaks.org
I'm using MS Word and it works perfectly but now I want to save the word document result as 'c:\MyDoc.docx'
Is there a save function that I can use????
Thanks for your Help.
Hanen TALBI
Hi.
I have almost that situation described in quoted link. But I need to print a letters for set of Customers in one Word document. In another words - for each Customer record I have one page in Word document, so if I would like to print 5 records from Customer table, I get 5 pages in Word.
I need help in modification of this code for creating one Word document for set of records:
Thanks in advance!
I've solved my problem by myself ](*,) ](*,) ](*,)
If someone interested, here is modified code:
please help, I have to deal with that today or I'll have a serious problem with the customer ((((((((((((((((((((((((((((((
Hanen TALBI
It work just for few Customers.
Any advice.
Thanks a lot