Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the properties of a WORD doc
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01253682
Message ID:
01253878
Views:
29
This message has been marked as the solution to the initial question of the thread.
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.
>I need to get at the properties, especially the key words in there, of word documents.
>
>I would open the doc and read in the keywords to add them to my database for quick searching.
>
>I assume it must be accessible from oWord.ActiveDocument....
>
>Or are those data actually stored outside of the document?
>
>
>I tried getting at this with a macro but that macro was empty
>
>
>Peter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform