|
-
Oct 22nd, 2003, 09:31 AM
#1
Thread Starter
Lively Member
[Resolved] Urgent: VB - Word - Combo Box - Automation...
I have a MS Word document that has several controls - text boxes and combo boxes. There is VBA code in the Word document to load values in the combo box.
I have a VB application that automates this word document. This application needs to paste text on to the text boxes and then read the combo box. It has to actually loop through the items, just like it is done in the visual basic programs.
Accessing the text boxes were easy. I name the bookmarks and am able to access them using the BookMarks and FormFields collection, but I am not able to access the combo box.
What is the way to access these combo boxes from a VB program?
Last edited by onbliss; Oct 22nd, 2003 at 12:34 PM.
-
Oct 22nd, 2003, 12:36 PM
#2
Thread Starter
Lively Member
solved it like this...
Used the Oleformat property in the Field object.
'use this to find if the contol is a ocx control
doc.Fields.Item(intCount).Type = wdFieldOCX
'then can access the values like this
doc.Fields.Item(intCount).OLEFormat.Object.List(i)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|