Question about finding paragraph styles in word

Hi everybody

I am just making my first experiences with apple script and am working on a script that opens up a word document, identifies the different chapters via recognition of the paragraph styles and after that copies each chapter into a separate file. ok that is the plan - I did some progress but the finishing line is still way ahead…

now I have the problem that when I try to use the following part of a script (it is not the whole thing):

set anzahl to count of paragraphs of active document
set headings to 0
repeat with i from 1 to anzahl
set myRange to text object of paragraph i of active document
select myRange
set strText to content of myRange
–display dialog (strText)
tell active document to set s to (get style of paragraph i)
if s = “heading1” then
set myItem to strText
set myList to myList & myItem
else
set myItem to 0
set myList to myList & myItem
end if
end repeat

I would suppose that due to the if-clause he will fill my “MyList” array with only the text which is formatted with heading 1 style, whereas all the other paras in between are marked with 0. The problem is that he is not finding any positive on heading1 (I have also tried with the German counterpart which can also be seen in the results-section being: “Ãœberschrift 1;H1”). If I try to get an info on variable “s” (display dialog (s)) he tells me that it cannot be converted to string. What can I do?

Thanks for any help.

Axel