Jump to content

Excel Data to MS Word Fields


Recommended Posts

Is there a way I could take a Excel Spreadsheet and populate a document with the data from the spreadsheet dumped in a certain format? For Example:

If I had a spreadsheet of data:

ColumnA ColumnB ColumnC

Data0 More Data0 Even More Data0

Data1 More Data1 Even More Data1

Data2 More Data2 Even More Data2

I want to populate a document with that data in a certain way:

Data0

More Data0 Even More Data0

Data1

More Data1 Even More Data1

Data2

More Data2 Even More Data2

I know how to store excel data to an array (_ExcelReadArray) and I know I can painfully open a new word doc and format it. I was hoping that I could just populate some unique fields over and over again.

I know my formatting in this post won't come out nice, but I hope I got the idea across.

Link to comment
Share on other sites

  • Moderators

Hi, AutoCraig. Have you looked into using _ExcelReadCell? You can always read the cells into variables, then dump them into your Word doc in whatever fashion you'd like.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

There is an Excel UDF and a Word UDF built into AutoIt. You can access the objects created/returned by this UDFs using pure AutoIt and do what you need.

Have a look at MSDN to get a reference of the Word COM.

You are a bit vague in your description what you want to do. Some more information is needed to really help you. Like:

  • What amount of data are we talking about? How big is your Excel file?
  • What do you mean by "populate some unique fields"?
  • Do you have a word template that needs to be filled or do you want to create the document froms cratch?
  • ...

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I'm not sure if the Word UDF supports you in more than opening a document and returning the object. Inserting text/data has to be done by you using the returned object.

Check the functions of the Word UDF and if you have further questions describe what you want to do as detailed as possible.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...