Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ParagraphFormat.Style Bug ??
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00575425
Message ID:
00575494
Vues:
24
This message has been marked as the solution to the initial question of the thread.
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform