简体   繁体   中英

OLE Object in PowerBuilder

Can anybody tell me how to set the value of a checkbox in a word document using OLE object?

I'm using form fields (dropdown and checkbox) in the Word document.

I am using PB 7.

Thanks!

I can't give you the exact PB syntax, but I can give you the Word object model syntax, which you shouldn't have any difficulty "translating".

oDocument.FormFields(index).CheckBox.Value = true  'or false

index can be either the position in the document (the n th form field in the text) or the name of the form field as a string ("Check1" for example).

Note that it's not possible to use the macro recorder to get this syntax since the macro recorder won't run in a document protected as a form and it's not possible to change the checkbox value if the document is not protected as a form.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM