refresh a vb control from within an embedded word app using vba?

C

coach_mikey

Hi gurus.

I have a vb application that opens a word document (within a framer
control). Then, using vba, I have code that lets the user add objects
(e.g. buttons) to the document. Each time an object is added to the
word document via vba, I need to execute a command that refreshes a
listbox (outside the vba app, but within the overall vb app) by adding
information about the added object to the list of objects. I have the
vba code writing to a database, and I have the vb list pulling data
from the database, so all I need to really do is refresh the list
control in the open vb project from within the nested vba code.

Does anyone know how/if this can be done?

I have tried: prjMain.frmAddComment.lstComments.refresh with no
success.

Thanks for any thoughts/ideas.
Mike
 
C

Cindy M -WordMVP-

Hi Coach_mikey,

This would probably be better directed to a classic VB group, but...

If the list is refreshing successfully, that means the VB project must
be reacting to some kind of event? How about using that event to
refresh/repaint after updating the list?
I have a vb application that opens a word document (within a framer
control). Then, using vba, I have code that lets the user add objects
(e.g. buttons) to the document. Each time an object is added to the
word document via vba, I need to execute a command that refreshes a
listbox (outside the vba app, but within the overall vb app) by adding
information about the added object to the list of objects. I have the
vba code writing to a database, and I have the vb list pulling data
from the database, so all I need to really do is refresh the list
control in the open vb project from within the nested vba code.

Does anyone know how/if this can be done?

I have tried: prjMain.frmAddComment.lstComments.refresh with no
success.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
C

coach_mikey

Thanks Cindy!! Sorry for delay in getting back. Although a little
quirky, the refreshing worked in the end!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top