word mail merge - importing data from excel to word checkbox/drop down fields - form-fields

I have a word form with checkboxes and drop down list…is there a way to import data from a excel spreadsheet…we plan on sending these out and need the fields in end product to be active so clients can change anything that is wrong (choose the right answer from the drop down list, check or uncheck boxes)

Related

Web Scrape Daily Treasury Rates

I have tried to write some VBA that scrapes a table from the URL below. I would like to create a macro that pulls in the data on a daily basis. Any help is much appreciated. Thank you
https://home.treasury.gov/resource-center/data-chart-center/interest-rates/TextView?type=daily_treasury_yield_curve&field_tdr_date_value_month=202212
I am having problems understanding HTML and the elements function.
I know you want to scrape that table on the treasury page, but it just has daily values of rates for each maturity duration (2yr, 5yr, etc.). These same rates are published every day in their XML feed.
The XML feed is meant to be consumed and parsed by computer code, while the HTML on that page is NOT meant to be parsed by "screen-scrapers".
If your macro pulled in the data from their XML feed every day instead, and you kept a table/log/whatever of each day's rates, after two weeks, you'd have the exact same data as the treasury HTML table, but NOT have all the headaches of trying to parse HTML and always worrying about your code breaking if their HTML layout changes.
Would this later approach work for you?
Update: Eric Salazar's answer reminded me of something. I don't know if you're using Excel VBA, or some other Office app, but if you ARE using Excel, you can use the "'Data Menu'->Get Data->From Other Sources->From Web" feature to import that treasury table into an Excel table. Simply copy the URL of that page, paste it into the URL field of the first dialog that pops up (keep type as "Basic"), click OK, click "Table 0" under Display Options of the next ("Navigator") dialog, and lastly click "Load". By default it will create a table in the current worksheet at the currently selected cell. It will contain all the columns of what's on the treasury page and a few more columns that will be filled with "N/A" (not sure where Excel is getting the N/A field names from). You can get rid of those fields by going into the Power Query Designer before importing the data (instead of clicking "Load" in the previous "Navigator" dialog, click "Transform Data" instead. This will open up the "Power Query Editor" and you'll see a table editor in the main window. Select the column headers you don't want to end up in the table and hit the "Del" key (or right-click and choose "Remove Columns"). The selected columns will now be gone. Now click "Close and Load" in the upper-left corner of the Power Query Editor window.
And like magic, Excel will create a new table on your current worksheet with the data contained on that treasury page. You can then access the table with regular VBA code to refresh and read the values.

How to create a macro in word to import multiple tables from excel?

Frequently in my job I need to generate reports with lots of tables of inputs and results. Especially for the result tables, one change in analysis may require editing a dozen spreadsheets. I'd like to create a macro in word that pulls in data from a spreadsheet, with each table on it's own tab, so that if I update any of those tables in excel the word document tables will also update. Given the number of tables/data points, I don't want to have to tell the macro to pull each single data point. The aim would be to reduce time and errors from manual entry.
I'm thinking this would involve the following steps, but not sure how to go about them:
1) Define the name/size for each table in word with matching name/size in excel
2) Tell the macro to pull the data into a table format
I'm not sure if this is possible as so far I've only seen how to insert a caption or a text box, not insert or update entire tables. Any help would be greatly appreciated!
Depending on what you're doing, you may not even need any VBA code.
If you copy a range from Excel and paste it into Word using Paste Special with the 'paste link' option, any subsequent changes in the Excel range will automatically be reflected in the document when the workbook is saved. And, if you name the range in Excel before copying/pasting, the Word content will expend/contract to reflect changes in the named range's scope in Excel. A variety of paste formats is supported.
Alternatively, you might use a DATABASE field in Word.

Add item to existing Sharepoint list from excel

I have a existing sharepoint list naming (Emp DB) which contains below fields
EmpID:
Emp Name:
Supervisor:
emailID:
Contact:
i want to add items frequently to the above list from excel sheet contains same fields as a columns. VBA coding is required...
Any help on this is very much appreciated....
The datasheet view is not a good way to do this. Either you use VBA and macro from excel or access to update the list. The problem I have is the exact same but with lookup columns to filter the form used to add a new object. When the cut and paste is done from excel the list can't figure out which column value to use and connect it to the value from another list.
I have also heard that you could use web services in SharePoint but i haven't got there yet. Here are some articles that may help you regarding VBA:
https://scottlyerly.wordpress.com/2014/06/26/excel-geeking-using-vba-and-ado-to-change-data-to-sharepoint-lists/
https://flylib.com/books/en/3.464.1.67/1/
https://sharepoint.stackexchange.com/questions/11426/update-list-from-excel-using-vba
Make sure that your list view and excel sheet columns are in the same order. Click the edit link inside "new item or edit this list" at the top of your list page. Now your list is in "datasheet view." Highlight the rows from excel that you want to enter and copy them. On your list page, click the leftmost cell of the empty row at the bottom, and do CTR+V. This should prompt you to "Allow Access" to your clipboard and paste your new entries onto the list.
If you have any trouble see this guide.

Moving Excel data fields to Word document

I am trying to make shipping labels for my clients and I need a hand. I have over 500 customers all in an excel file with the usual (Name, Phone #, Address) data fields.
I want to create a VBA that will automatically run a loop to fill my word document with the right data from the Excel file. The word document will be small labels.
It sounds like you need Mail Merge. Check out the links below. That should do what you want.
https://www.ablebits.com/office-addins-blog/2014/05/08/mail-merge-excel-word/
http://www.gcflearnfree.org/print/word2013/mail-merge?playlist=Word_2013
http://www.wa.gov/esd/training/docs/quick_guides/MailMergewithExcelDataFiles.pdf
https://www.youtube.com/watch?v=qiuh7qmA_uc

Populate table in Word Template with VBA?

I'm filling in a Word template with data that's been collected from user input. In particular a (variable) number of documents is chosen, and information about each document fills a row of a table.
I've bookmarked several items in the template and successfully filled information in the header from my macro, but the table I'm not so sure with. I bookmarked the first cell and tried tabbing (with Chr(9)) through, and also tried passing an array. (In the template the table has only a first row. Usually tabbing past the last column creates an additional row.)
I can retieve cell contents with
Word.Application.ActiveDocument.Tables(1).Cell(3, 1).Range.Text
but can't write to the any cell except the first, where I placed a bookmark.
Can anyone offer a possible solution to populate the table?
To populate table, use this code
ActiveDocument.Tables(1).Cell(1, 1).Range.Text = "Blah Blah"
This will write to the first cell in the first table. Use a loop to fill the rest of the cells.
I would also recommend see this link.
Topic: Automating Word Tables for Data Insertion and Extraction
Link: http://msdn.microsoft.com/en-us/library/aa537149%28v=office.11%29.aspx#Y1254
Extract:
Summary: Learn how to automate the creation and formatting of tables in Word. Get information about optimizing performance, populating a table with data, formatting table structure, linking table data, and extracting data from a table. (25 printed pages)
I've actually ran into a similar problem using Access to automate filling out a Word table template. I found that if I opened the template in Word prior to running the VBA script, then the Word document is successfully filled out with the table information. My code looks similar to yours as far as adding to it by row. Because the number of fields to be transferred to the form is dynamic it didn't seem like bookmarks for each section would work. If you have any update, I'd be happy to hear of a different way to resolve this.