Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

Help! Object Variable or With Block variable not set

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mhawbs@gmail.com - 13 Oct 2005 20:22 GMT
I know this should be a simple problem but I just cant seem to get it
right.  I have built a custom toolbar using Word VBA that works fine.
However, my toolbar contains a combobox with a list of options.  I am
trying to write a routine that will access the .text value of the combo
box so it can do the appropriate thing based on the user choice in the
combobox.  So basically my code works like this...

'+++++++++++++++++++++++++++++++++++++++++++++++++++++

Public CBarCategoryComboBox As Office.CommandBarComboBox
Dim Qtype as String

Private Function SetupCommandButtons() As Boolean

    'Create my toolbar including the combobox in question
    'Combobox is called CBarCategoryComboBox

End Function

Private Sub InsertQuestion()

    '-> I need to get the value of the combobox from this routine and
THIS IS WHERE I GET THE OBJECT VARIABLE OR WITH BLOCK VARIABLE NOT SET
ERROR 91!
    QType = CbarCategoryComboBox.Text

   'etc.....

End Sub

Could somebody tell me why I cant access the CBarCategoryComboBox.text
value without this error?

Thanks.

Mike
mhawbs@gmail.com - 13 Oct 2005 21:30 GMT
Good to see I wasnt going crazy.  In case anyone down the road runs
into this problem here is the answer.

http://support.microsoft.com/default.aspx?scid=kb;en-us;319832

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.