>*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.>>