Group:  Microsoft Word ยป microsoft.public.word.vba.beginners
Thread: Getting the value of an unbookmarked checkbox

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Getting the value of an unbookmarked checkbox
"mdb" <mdbloemker[ at ]gmail.com> 26.09.2006 12:40:01
I have hundreds of forms I've been tasked to extract data from into an
Excel spreadsheet. The VBA script I developed performs the task well,
but it depends entirely upon the Bookmark name to retrieve values that
are Checkbox and Textbox. Turns out that four checkboxes on all these
forms were somehow created without a Bookmark name, so VBA has nothing
to grab onto, thereby skipping those fields. I've tried modifying my
script to do a Selection.Find and writing the resulting Selection.Text
to the Excel Object, but this only gets me the FACT that there is a Yes
and a No, not which one is actually checked. However, if I manually
Select, then copy to Notepad or any other Text Editor, what gets pasted
is, for example, Yes 1 No 0.

That I could work with. What I've been unable to find is a way to open
up a Notepad or other Text Editor object that would allow the VBA
script open Word doc/find/select/copyto clipboard/goto already open
Text Editor/paste/go back to Word object/close Wobj/ open next W doc.
That is to say, I've got everything except '...goto already open Text
Editor/paste/go back to Word object...' figured out. I don't need
step-by-step, just yes/no if it's possible and if so, high level how to
do it. Even Google keywords suggestions would help, I seem to have
exhausted my keywords.

OR if there's a way in VBA to pick up the value of UNbookmarked
checkboxes, I'd be forever grateful for pointers in that direction. My
boss is making noises about me having to go into over 600+ Word
documents, to retrieve the information manually, and if that happens,
I'll need someone to post bail.

Re: Getting the value of an unbookmarked checkbox
"Dave Lett" <davelett[ at ]NOaolSPAM.com> 26.09.2006 13:59:08
Hi,

Can you use something like the following:

Dim iFld As Integer

For iFld = 1 To ActiveDocument.FormFields.Count
If ActiveDocument.FormFields(iFld).Type = wdFieldFormCheckBox Then
'''run your routine here
End If
Next iFld


HTH,
Dave

"mdb" <mdbloemker[ at ]gmail.com> wrote in message
news:1159274401.186679.111750[ at ]i3g2000cwc.googlegroups.com...
[Quoted Text]
>I have hundreds of forms I've been tasked to extract data from into an
> Excel spreadsheet. The VBA script I developed performs the task well,
> but it depends entirely upon the Bookmark name to retrieve values that
> are Checkbox and Textbox. Turns out that four checkboxes on all these
> forms were somehow created without a Bookmark name, so VBA has nothing
> to grab onto, thereby skipping those fields. I've tried modifying my
> script to do a Selection.Find and writing the resulting Selection.Text
> to the Excel Object, but this only gets me the FACT that there is a Yes
> and a No, not which one is actually checked. However, if I manually
> Select, then copy to Notepad or any other Text Editor, what gets pasted
> is, for example, Yes 1 No 0.
>
> That I could work with. What I've been unable to find is a way to open
> up a Notepad or other Text Editor object that would allow the VBA
> script open Word doc/find/select/copyto clipboard/goto already open
> Text Editor/paste/go back to Word object/close Wobj/ open next W doc.
> That is to say, I've got everything except '...goto already open Text
> Editor/paste/go back to Word object...' figured out. I don't need
> step-by-step, just yes/no if it's possible and if so, high level how to
> do it. Even Google keywords suggestions would help, I seem to have
> exhausted my keywords.
>
> OR if there's a way in VBA to pick up the value of UNbookmarked
> checkboxes, I'd be forever grateful for pointers in that direction. My
> boss is making noises about me having to go into over 600+ Word
> documents, to retrieve the information manually, and if that happens,
> I'll need someone to post bail.
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net