I guess it doesnt make much sense to do this since these are permanents and once written, there is no need to re-fill them out.
However I want this to be dynamic from a different datasource.
Code: Select all
Sub GetMetaData
vDoc = ThisComponent
vInfo = vDoc.getDocumentInfo()
For i = 0 to vInfo.GetUserFieldCount() -1
sKey = vInfo.GetUserFieldName(i)
sVal = vInfo.GetUserFieldValue(i)
s = s & Chr$(13) & "(" & sKey & "," & sVal & ")"
Next i
MsgBox s, 0, "User Fields"
End SubCode: Select all
oPropValues() = ThisComponent.getDocumentInfo().getPropertyValues()
MsgBox oPropValues(0).Value
Or Master fileds are worked with:
Code: Select all
oDoc = thisComponent
objField = oDoc.createInstance("com.sun.star.text.TextField.User")
sName = "com.sun.star.text.FieldMaster.User." + strVarName