Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating CustomDocumentProperties in Word from VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01123141
Message ID:
01123152
Vues:
17
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform