Link to home
Start Free TrialLog in
Avatar of spiral2007
spiral2007

asked on

how can i change the option button value from vb.net to a word 2007 document?



hello experts,

i have a word 2007 document that contains a report. I am trying to complete the report from vb.net. i had successfully complete the text fields part but now i cant figure out how to change the option buttons value.

Any ideas?

here is a sample code from my project...
Avatar of Dhanasekaran Sengodan
Dhanasekaran Sengodan
Flag of India image

can u explain briefly and post sample code?
Avatar of spiral2007
spiral2007

ASKER

hello dhansmani,

here is a sample code.

i can access text boxes and change their values but i dont know how to access radio buttons (Option Buttons in MS Word 2007) and change their values from uncheck to check
oWord = CreateObject("Word.Application")
        oWord.Visible = True
        oDoc = oWord.Documents.Add("C:\myReport.dotm")

        oDoc.Bookmarks.Item("txtName").Range.Text = tb(0)("Name")
...
...
..

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Dhanasekaran Sengodan
Dhanasekaran Sengodan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i did find any useful information...
sorry .. i didnt find any useful information ..
i find it thanks dhansmani!

         

oDoc.Bookmarks.Item("optionbuttonyes").Range.InlineShapes(1).OLEFormat.Object.value = True
            oDoc.Bookmarks.Item("optionbuttonno").Range.InlineShapes(1).OLEFormat.Object.value = False

Open in new window

oDoc.Bookmarks.Item("optionbuttonyes").Range.InlineShapes(1).OLEFormat.Object.value = True