Read Word ActiveX radio button into vb.net form -
i'm working on code read values in word document windows form using vb.net. word document designed data read in contained within content controls. here sample of code:
private sub importwordbutton_click(sender object, e eventargs) handles importwordbutton.click dim oword microsoft.office.interop.word.application dim odoc microsoft.office.interop.word.document dim occ microsoft.office.interop.word.contentcontrol oword = createobject("word.application") odoc = oword.documents.open("c:\temp\pifformtest2.docx", [readonly]:=false) each occ in odoc.contentcontrols select case occ.tag case "pifno" numberbox.text = occ.range.text case "piftitle" titlebox.text = occ.range.text case "initiator" initiatorbox.text = occ.range.text case "pthealthsafety" healthsafecheckbox.checked = occ.checked case "ptregenviro" regenvcheckbox.checked = occ.checked
... goes on. of content in word file captured activex radio buttons rather content controls. can't seem find correct object referring radio buttons. i've spent significant time searching web. appreciated.
i'm working on too, , it's nightmare.
for each f field in odoc.fields 'notice fields not content controls console.writeline(f.oleformat.object.name) 'notice properties, not methods... next
Comments
Post a Comment