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 / February 2008

Tip: Looking for answers? Try searching our database.

How to access value of combobox in word document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Piotr Chmielewski - 11 Feb 2008 08:11 GMT
Hi,

I'm trying to fix/change an Excel VBA macro that opens selected word
document and extracts some data from it. Unfortunately, I cannot find
any info how to access the value of combo box in that document (the
one from control toolbox, not a form). Any idea how to do that?

Regards
Piotr
Doug Robbins - Word MVP - 11 Feb 2008 09:30 GMT
Using the .Value attribute of the combobox should return the item that is
selected in the boundcolumn.
Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hi,
>
[quoted text clipped - 5 lines]
> Regards
> Piotr
Piotr Chmielewski - 11 Feb 2008 13:05 GMT
>> "Piotr Chmielewski" <krecik2002@tlen.pl> wrote in message
> news:foovvr$ra6$1@inews.gazeta.pl...
[quoted text clipped - 4 lines]
>> any info how to access the value of combo box in that document (the
>> one from control toolbox, not a form). Any idea how to do that?

> Using the .Value attribute of the combobox should return the item that is
> selected in the boundcolumn.

This is out of the question. However, I don't know how to access
combobox object at all :) You know, when I have an word document
object created, let's name it "doc", it's easy to access for example
table cell, it would be something like: doc.Tables(1).Cell(1,1).Range.
But how to access combobox and therefore all of it's attributes in
this document?

Regards
Piotr
Doug Robbins - Word MVP - 12 Feb 2008 09:33 GMT
See
http://groups.google.com/group/microsoft.public.word.vba.general/browse_thread/t
hread/569c3d181115cd5a/5f2c5ed406199c07?lnk=st&q=#5f2c5ed406199c07


Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>>> "Piotr Chmielewski" <krecik2002@tlen.pl> wrote in message
>> news:foovvr$ra6$1@inews.gazeta.pl...
[quoted text clipped - 17 lines]
> Regards
> Piotr
Piotr Chmielewski - 12 Feb 2008 15:20 GMT
> See
> http://groups.google.com/group/microsoft.public.word.vba.general/browse_thread/t
hread/569c3d181115cd5a/5f2c5ed406199c07?lnk=st&q=#5f2c5ed406199c07

Ok, at the beginning I was also trying references to doc.Shapes.blabla,
But finally my friend helped me, and the solution is as simple as it gets:
doc.combobox1.Value
where doc is opened document object and combobox1 is name for
combobox I'm trying to get value for :)
Thanks for your response though.

Regards
Piotr
Doug Robbins - Word MVP - 12 Feb 2008 19:58 GMT
See my response to your initial post.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>> See
>> http://groups.google.com/group/microsoft.public.word.vba.general/browse_thread/t
hread/569c3d181115cd5a/5f2c5ed406199c07?lnk=st&q=#5f2c5ed406199c07

[quoted text clipped - 8 lines]
> Regards
> Piotr
Piotr Chmielewski - 12 Feb 2008 20:56 GMT
> See my response to your initial post.

Yes, you were right, but my question should be more like: "how to refer to
combobox
object at all". I was trying  things like: doc.shapes.combobox1.value etc,
didn't suppose
that it may be so simple...

Regards
Piotr
 
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.