Erweiterte (Eigene) Dokumenteneigenschaften aus geöffnetem Worddokument auslesen.
Aufruf:
Public Function GetCDP(ByRef WordDoc As Office.Interop.Word.Document, ByVal Prop As String) As String
Dim _cdp As Object = WordDoc.CustomDocumentProperties
Dim TypBuiltProps As Type = _cdp.GetType
Dim _prop As Object
Dim _proptype As Type
_prop = TypBuiltProps.InvokeMember("Item", System.Reflection.BindingFlags.Default Or System.Reflection.BindingFlags.GetProperty, Nothing, _cdp, New [Object]() {Prop})
_proptype = _prop.GetType
GetCDP = _proptype.InvokeMember("Value", System.Reflection.BindingFlags.Default Or System.Reflection.BindingFlags.GetProperty, Nothing, _prop, New [Object]() {}).ToString.Trim
End Function
Kommentare zum Snippet