Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the properties of a WORD doc
Message
From
13/09/2007 16:23:10
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01253682
Message ID:
01254206
Views:
18
Is there any documentation what those 30 builtinDocumentproperties are?

I found nothing on Google
Peter


>There's no need for additional J varable in the last loop because J=I-1.
>
>*j = 1
>For i = 2 To nCount
>  .Cell(i, 1).Range.Text = lodoc.BuiltInDocumentProperties(i-1).Name
>  .Cell(i, 2).Range.Text = Transform(lodoc.BuiltInDocumentProperties(i-1).Value)
>  *j = j + 1
>Endfor
>
>
>>
ON ERROR *
>>o = Createobject('word.application')
>>lodoc2 = Getfile('doc')
>>lodoc = o.documents.Open(lodoc2)
>>lodoc3 =o.documents.add()
>>nCount = lodoc.BuiltInDocumentProperties.Count
>>rng = lodoc3.Range(0,0)
>>With rng
>>.InsertBefore("Document Statistics")
>>.Font.Name = "Verdana"
>>.Font.Size = 16
>>.InsertParagraphAfter()
>>.InsertParagraphAfter()
>>.SetRange(rng.End, rng.End)
>>Endwith
>>rng.Tables.Add(lodoc3.Paragraphs.Item(2).Range,nCount,2)
>>With lodoc3.Tables.Item(1)
>>.Range.Font.Size = 12
>>.Columns.DistributeWidth()
>>.Style = "Table Colorful 2"
>>Endwith
>>With lodoc3.Tables.Item(1)
>>.Cell(1, 1).Range.Text = "Document properties"
>>.Cell(1, 2).Range.Text = "Value"
>>j = 1
>>For i = 2 To nCount
>>.Cell(i, 1).Range.Text = lodoc.BuiltInDocumentProperties(j).Name
>>.Cell(i, 2).Range.Text = Transform(lodoc.BuiltInDocumentProperties(j).Value)
>>j = j + 1
>>Endfor
>>.Select()
>>ENDWITH
>>lodoc.close
>>o.Visible = .T.
>>
>>
Peter Cortiel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform