0

I'll spare the details but essentially I want to make a study guide or book for language learning purposes. I was wondering if there was a quick and easy way (or even difficult way lmao) to quickly export cells to a Word document following some specific format? I made an example Excel and Word document to explain better, but don't worry, I won't keep it in that format haha it's ugly. I just want to know if there's a way to take information from a cell and paste it onto a specific line in Word etc. Would I have to write some script...? Any help would be appreciated!

This screenshot shows what I am trying to do. Example of what I want to achieve

EDIT I tried to do some VBA but I'm lost.

Sub dataToWord()

    Dim wordApp As Word.Application
    Dim templateFile As Object
    Dim c As Integer
    
    On Error Resume Next
    Set wordApp = GetObject(, "Word.Application") 'gives error 429 if Word is not open
    On Error GoTo 0 'stop ignoring errors
    If wordApp Is Nothing Then
        Set wordApp = CreateObject("Word.Application") 'creates a Word application
    End If

    wordApp.Visible = True

    Set templateFile = wordApp.Documents.Open(ThisWorkbok.Path & "/" & Range("E1").Value & ".docx")
    wordApp.Visible = True
    c = 2
    
    For i = 1 To 3
            
            templateFile.ContentControls(i).Range.Text = Sheets("Data").Cells(2, c)
            c = c + 1

    Next i
    
    wordApp.Documents.Close
    wordApp.Quit
    
End Sub

The Excel and Word documents I'm using look like this

I was looking at tutorials and found Mail Merge as well so I might just do that.

EDIT 2

Moved on the using Mail Merge but having trouble with accent marks. The problem is that the letters show as an underscore See here

4
  • That could probably done with VBA, but please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How to Ask.
    – DavidPostill
    Commented May 2, 2021 at 20:04
  • Alright well I wasn't expecting anyone to write it for me. I haven't written any scripts as I'm not well versed on that anymore. Figured I'd come on here to get suggestions. I'll look up VBA tutorials and go from there. Commented May 2, 2021 at 20:07
  • No need for vba. Mail Merge is a real possibility. Here is my page: addbalance.com/usersguide/mailmerge.htm Here is the Microsoft Page: support.microsoft.com/en-us/office/… You have the data in Excel and do the formatting in Word. You can include images. Here is Graham Mayor's page on that: gmayor.com/mail_merge_graphics.htm Commented May 2, 2021 at 21:14
  • @CharlesKenyon Thank you! The tutorials you sent were very helpful. I've accomplished what I wanted to do, but I am having trouble with the unicode of some words. I'm adding romanization of some Chinese characters which have accent marks, but when I cycle through the mail merge, I just see _ where the character should be. This is what is showing up Commented May 5, 2021 at 2:37

1 Answer 1

1

Mail merge was primarily put together to allow one letter or other document to be sent with multiple recipients in mind. However, as @CharlesKenyon pointed out in the comments, it can be used with graphics and I think that mail merge is the way to go.

You will be linking your Word document to your Excel file and as soon as you make any changes with the Excel file, the Word file will update accordingly.

You just use the Word file to format your final document the way you want it to look.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .