Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating CustomDocumentProperties in Word from VFP
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01123141
Message ID:
01123152
Views:
15
This message has been marked as the solution to the initial question of the thread.
#DEFINE msoPropertyTypeNumber	1	
#DEFINE msoPropertyTypeBoolean	2	
#DEFINE msoPropertyTypeDate	3	
#DEFINE msoPropertyTypeString	4	
#DEFINE msoPropertyTypeFloat	5	

oWord = CREATEOBJECT("Word.Application")
oDoc = oWord.Documents.Add()
oCDP = oDoc.CustomDocumentProperties

oCDP.Add("My Property 1",.F.,msoPropertyTypeString , "Something")
oCDP.Add("My Property 2",.F.,msoPropertyTypeBoolean , .T.)
oCDP.Add("My Property 3",.F.,msoPropertyTypeDate, DATETIME())

FOR i=1 TO oCDP.Count
	oProp = oCDP.Item(i)
	? oProp.Name, "=", TRANSFORM(oProp.Value)
ENDFOR
>In MS word we can define CustomDocumentProperties for Word documents. How can we define them from within VFP using ole automation?
>
>I tried figuring this out by recording a macro in MS word while I defined such properties manually, but the macro did not record this in code.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform