Results 1 to 2 of 2

Thread: [Resolved] Urgent: VB - Word - Combo Box - Automation...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    65

    Unhappy [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.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    65

    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
  •  



Click Here to Expand Forum to Full Width