Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

Check Checkbox in Code

瀏覽次數:112 次
跳到第一則未讀訊息

Derek Hart

未讀,
2001年11月20日 下午6:32:312001/11/20
收件者:
I have a form field checkbox on a word document. I am trying to control it
in VBA. I tried setting it to True or 1 to check the box. This does not
seem to work? Any ideas on how to check this? Do I have to insert a
Winddings checked box character in code?

Derek

~ Dian Chapman ~

未讀,
2001年11月20日 下午6:44:302001/11/20
收件者:
This code sets a form field checkbox to checked...

ActiveDocument.FormFields("ckCheckboxName").CheckBox.Value = True

Dian Chapman
Technical Consultant
& Microsoft MVP

More tips: http://www.mousetrax.com
Word MVP FAQs: http://www.mvps.org/word/index.html
MS newsgroups via browser: http://communities.microsoft.com/newsgroups

On Tue, 20 Nov 2001 15:32:31 -0800, "Derek Hart" <dmh...@gte.net>
wrote:

Derek Hart

未讀,
2001年11月20日 下午6:58:452001/11/20
收件者:
But this checkbox does not have a name. It is a check box form field. I
highlighted the check box and inserted a bookmark over it. Now I am trying
to choose the bookmark in code, and check it. Is this possible, or do I have
to add a real checkbox from the control toolbox?

Derek

"~ Dian Chapman ~" <di...@mousetrax.com> wrote in message
news:3bfaea7d....@msnews.microsoft.com...

Derek Hart

未讀,
2001年11月20日 晚上7:06:572001/11/20
收件者:
Never mind, I found it has a name.

Derek

"Derek Hart" <dmh...@gte.net> wrote in message
news:e1OmX9hcBHA.1544@tkmsftngp03...

~ Dian Chapman ~

未讀,
2001年11月21日 凌晨1:16:432001/11/21
收件者:
Yes...ALL form fields have default names (bookmark names)...like
textbox1, checkbox1, checkbox2, dropdown1, etc.

Just have to double click the form field to open the PROPERTIES dialog
to see the bookmark and set any defaults.

Dian D. Chapman


Technical Consultant
& Microsoft MVP

More tips: http://www.mousetrax.com
Word FAQ: http://www.mvps.org/word
Microsoft Support groups: http://communities.microsoft.com/newsgroups

0 則新訊息