Let's say I have an Excel spreadsheet with 3 columns (Name, Wife, date of death).
Let's say I want to create a Word document that takes those three columns worth of date and prints it to the document like this:
John Doe married Jane Jones and he died 1 Apr 2014.
Sometimes, however, the person in the spreadsheet never married so the Wife cell for this record is blank in which case the output would be:
John Doe died 1 Apr 2014.
What would be the best way to create the document? The output will be 8 pages worth of records. Would the easiest way be to send the Excel data to Word or some other method? I don't know how to reference the Excel data in Word vba so my first question is how do I reference Excel cells in vba in Word?
Or is there an easier way to do this. I can't do it via Mail Merge or similar because there are going to be about 25 columns worth of data and if certain cells are empty then I need to change the way the data is "described" when it's output.
I've used VBA quite a bit over the years, but I'm not an expert. That said, I've never tried to do what I'm wanting to do here so I just don't know where to start.
Let's say I want to create a Word document that takes those three columns worth of date and prints it to the document like this:
John Doe married Jane Jones and he died 1 Apr 2014.
Sometimes, however, the person in the spreadsheet never married so the Wife cell for this record is blank in which case the output would be:
John Doe died 1 Apr 2014.
What would be the best way to create the document? The output will be 8 pages worth of records. Would the easiest way be to send the Excel data to Word or some other method? I don't know how to reference the Excel data in Word vba so my first question is how do I reference Excel cells in vba in Word?
Or is there an easier way to do this. I can't do it via Mail Merge or similar because there are going to be about 25 columns worth of data and if certain cells are empty then I need to change the way the data is "described" when it's output.
I've used VBA quite a bit over the years, but I'm not an expert. That said, I've never tried to do what I'm wanting to do here so I just don't know where to start.