#1
|
|||
|
|||
Check Box Form Field Book Mark Auto Fill?
Hi,
I'm wondering if there is a way to auto-fill all check box form field bookmarks (in field settings) in a document? I have a document template with about 3,500 check box form fields, and I'm trying to write a macro in Excel to auto populate an Excel sheet based off of which check boxes are marked. I don't really care what the actual bookmark names are, but each one does need to be unique. If possible I'd like to use numbers 1 - 3,500 but I don't think that's possible. Thanks! Z |
#2
|
||||
|
||||
Your post is unclear.
First you say you want to "auto-fill all check box form field bookmarks (in field settings) in a document", but checkboxes only have true/false states. Then you say you want to "write a macro in Excel to auto populate an Excel sheet based off of which check boxes are marked". What are you trying to populate? Word or Excel? As for "I'd like to use numbers 1 - 3,500 but I don't think that's possible", why does it matter whether they're bookmarked?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
I'm sorry if you didn't understand my post.
Basically I'm trying to auto populate the bookmarks for 3500 checkbox formfields in a Word document. Currently none of the checkbox field settings have bookmarks defined, I need each of the 3500 checkboxes to have a unique bookmark defined - preferably automatically... something like check1, check2, check3... check3500 Hope this helps Thanks! |
#4
|
||||
|
||||
It is a bit hard to understand what you want when you say things like "a macro in Excel to auto populate an Excel sheet"...
You still haven't explained what bookmarking the checkboxes is supposed to achieve. If they're in the same order as the data in the Excel workbook, there doesn't seem to be any need for that. Indeed, relying them is likely to increase your maintenance overheads.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
The Excel workbook essentially has a single cell associated with each checkbox in the Word document. The word document has a group of 12 check boxes per item. The first checkbox in the word document associates with cell B4, second checkbox with cell C4, third checkbox with cell D4 etc. to M4. Then it transitions to B5, C5, D5... M5 etc.
The Excel macro I've been testing to pull the data out of the Word document is: Code:
Sub wrd12() Dim wrd As Word.Application Set wrd = CreateObject("Word.Application") With wrd .Documents.Open "C:\path\to\word.docx" .Visible = True End With Range("b4").Value = wrd.ActiveDocument.FormFields("check1").Result Range("c4").Value = wrd.ActiveDocument.FormFields("check2").Result Range("d4").Value = wrd.ActiveDocument.FormFields("check3").Result Range("e4").Value = wrd.ActiveDocument.FormFields("check4").Result Range("f4").Value = wrd.ActiveDocument.FormFields("check5").Result Range("g4").Value = wrd.ActiveDocument.FormFields("check6").Result Thanks |
#6
|
||||
|
||||
If the checkboxes are the only formfields in the document, you could use:
Range("b4").Value = wrd.ActiveDocument.FormFields(1).Result Range("c4").Value = wrd.ActiveDocument.FormFields(2).Result Range("d4").Value = wrd.ActiveDocument.FormFields(3).Result
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Form auto fill based on a different field value. | stct | Word | 26 | 06-15-2019 04:08 PM |
Question about auto-fill form | Dsp581 | Word | 3 | 04-04-2013 11:27 PM |
Nested if field that contains a fill-in field is not prompting for fill-in info | Nccadm | Mail Merge | 2 | 04-02-2013 03:15 AM |
Form file timesheet, auto fill date from calander | jkeeney | Word | 1 | 03-21-2012 12:21 AM |
How can I fill in form I received in email that used underlines instead of text field | Gail L. | Word | 2 | 05-17-2009 12:38 PM |