954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help Would Be Greatly Appreciated!

Hello, I am working on a combo box, Visual Basic 6.5 on Microsoft Word 2003. When I put in the text for the combo box, it loads fine. I save, close the document. When I re-open the file, everything in the drop box is gone. What am I doing wrong?

MichellePV
Newbie Poster
10 posts since Nov 2010
Reputation Points: 10
Solved Threads: 0
 

Where does the "text" that populates the combo box come from? Is it from a database or another text file?

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

I tried everything - a text file, just adding an item...I get the same results. When I run the page, it works great. I save it, close the file, re-open, and everything is gone. Is there a code I am missing? Thank you for your help!

MichellePV
Newbie Poster
10 posts since Nov 2010
Reputation Points: 10
Solved Threads: 0
 

PS - For instance, what would the code for a combo box be that has "Jan.", "Feb.", etc. in it?!

MichellePV
Newbie Poster
10 posts since Nov 2010
Reputation Points: 10
Solved Threads: 0
 

You can add the following code directly to the Document_Open event or you can add it in a stand alone module and call the sub when the document opens.

With ActiveDocument.ComboBox1
.Clear
.AddItem "January"
.AddItem "February"
.AddItem "March" 'And so on......
End With


You can also try the following under the UserForm_Initialize event -

Me.ComboBox1.List = Split("January|February|March") 'And so on...
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Thank you for your help. It worked initially, but then when I re-opened the document four or five times later, everything disappeared again. I think there is a "glitch" in the system.

MichellePV
Newbie Poster
10 posts since Nov 2010
Reputation Points: 10
Solved Threads: 0
 

It was a pleasure.:) Happy coding.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You