![]() ![]() Select the Legacy Form control or Active X Control that you want to include. Go to Developer > Legacy Forms drop-down. I also added an Else to the If in the Case statement.Legacy form controls are for compatibility with older versions of Word and consist of legacy form and Active X controls.Ĭlick or tap where you want to insert a legacy control. I named the two checkbox content controls with Tag property values of: TextBox1 and TextBox2. In this type of control, if you want to use a name, set the Tag property as I did or use the Title property and change the code accordingly. It makes no sense to me to offset the column number by one for one case. You need to evaluate the Case for those though. I went ahead and added two checkboxes to test it. This might still need a tweak for the checkedbox Select Case but might be a bit more clear for you. Here is where it put all the values in except for the checkedbox as I explained. Rather than doing the If, one could just set the vValue in the Select Case. You can just add that one control in a file and step through it to see what the Select Case was doing. I did not check the checkedbox case though. 'Case vField.Checked = True And vField.Checked If vField.Type = wdContentControlCheckBox Then 'Or vField.Type = wdContentControlRichText Or vField.Type = wdContentControlComboBox Or vField.Type = wdContentControlDropdownList Or vField.Type = wdContentControlText Then ![]() I'll mark this thread solved tomorrow after I checked it really took ALL the fields in my final docs. If anyone could explain why it didn't work when specified but did when not specified that would help me a lot in better understanding VBA. Okay, (spamming my own thread I noticed that actually the only field it picked was the one I forgot to specify (CheckBox instead of Date) so I commented out all the others and now it works? Not quite sure why that is, but it works so that's good. ![]() If = "1" Then cell.Value = "YES"Ĭase = True And vField.Checked = False If vField.Type = wdContentControlCheckBox ThenĬase vField.Checked = True And vField.Checked ''''''' Workbooks("DARTS.xlsm").Activate 'Needed? Not needed if macro ran from it. OutPath = "C:\Documents and Settings\richard.b.rivera\Desktop\dart Processed\"įor Each vField In wdApp.Documents(myDoc).ContentControls InPath = "C:\Documents and Settings\richard.b.rivera\Desktop\dart UnProcessed\" ' Add Tools > References: Microsoft Word and Microsoft Scripting Runtime You might want to check for True or False rather than "1" or "0" to set the Yes or No for cell.Value. "Q:\Sales Reports\Processed\" & vFileName ![]() VLastRow = + 1įor Each vField In wdApp.Documents(myDoc).FormFields I pinned down the problem to being just a wording problem in MS, but then again, it might be a little more complicated Meaning: copying the contents of the fields from all the different reports into 1 excel report.īelow is a Macro I found which works for legacy forms (FieldForm) (pre-2007) but I cannot seem to make it work for 2010. These contains all kinds of different Content Control fields (Drop down, rich text, dates etc.), and the data in there should be copied to an excel sheet. I've been searching all kinds of fora for this problem and although I find information on how to do this with (legacy) Form Fields, my problem involves Content Control fields and I can't seem to fix this.īasically I have Sales Reports that are being filled out on a weekly basis by all Sales Reps. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |