Hi,

I've been playing around with Excel and macros and appear to need to step into the world of VBA.

My goal is to trigger a Word mail merge from within Excel (presumably via control button and macro), using the current Excel workbook as the data source, and referencing a Word .dotx document in a shared location as the template for the mail merge.

I've found some code on the Web, but it was written for a much older version of Excel, and I'm having issues with it: can't post link but its from MrExcel.com

Anyone have insights as to whether this should word for O365?

I'm getting a VBA Compile error - User-defined type not defined for the third line:
Sub DoMailMerge()
'Note: A VBA Reference to the Word Object Model is required, via Tools|References
Dim wdApp As Word.Application, wdDoc As Word.Document

What am I doing wrong?

Any guidance would be appreciated.

Thanks