> I am trying to automate the process of creating documents by taking data from my bank via WORD.
> I have windows 7, word starter 10.
> I looked for some examples:
>
http://www.tomorrowssolutionsllc.com/ConferenceSessions/Automating%20Microsoft%20Word.PDF>
>
https://docs.microsoft.com/en-us/office/vba/api/word.range.style>
>
http://portal.dfpug.de/dfpug/Dokumente/Partner/Hentzenwerke/Microsoft%20Office%20Automation%20with%20Visual%20FoxPro%20Chapter%2006.pdf>
>
> And on many attempts, the VFP issues error message.
>
> In this code :
>
> oRange = oDocument.Range()
> WITH oRange
> .Style = oDocument.Styles[ "Heading 1" ]
>
> this error message "OLE IDISPATCH EXCEPTION CODE 0 FROM MICROSOFT WORD: COLLECTION REQUESTED MEMBER DOES NOT EXIST"
>
It sounds like you don't have a style named "Heading 1" in the document. I've never worked with a version of Word that isn't in US English. Are style names in non-US editions in English or in the local language?
If that's not the issue, are you using a custom template or the default template? If custom, does your template have a Heading 1 style?
Tamar