Hi,
Although you can set a style using constant, Style property is an object.
Expression "myRange.Style = wdStyleNormal" is equivalent to "myRange.Style = Styles(wdStyleNormal)".
Try this:
loWord = CREATEOBJECT('word.application')
loDoc = loWord.Documents.Open(lcMyDocument)
?loDoc.Paragraphs(1).Style.NameLocal
?loDoc.Paragraphs(1).Format.Style.Font.Name
>Possible bug:
>When using MS Word automation in both VFP6 and VFP7 the style property for both the paragraphs object and the paragraphsformat object return an object not an integer as expected.
>The following code should display two integers but instead it generates "operator/operand mismatch" errors.
>
>loWord = CREATEOBJECT('word.application')
>loDoc = loWord.Documents.Open(lcMyDocument)
>?loDoc.Paragraphs(1).Style
>?loDoc.Paragraphs(1).Format.Style
>What the docs say about the style property:
>All other objects: Returns or sets the style for the specified object. To set this property, specify either the local name of the style, an integer or a WdBuiltinStyle constant (see "Remarks"), or an object that represents the style. Read/write Variant.
>Has anyone seen this? I could not find a KB article on it.