Excel VBA Word Automation Not Working with Office 2013
In my company, we generally have Office 2007.
I have a program that creates a Sales Letter in MS Word. The file already exists with formatting set up, but I've created Bookmarks in the Word document that I can then replace with text according to the Excel file. In other words, each key element in the Word document (e.g. Customer Name) has a book mark with dummy text that gets overwritten with a value from the Excel file.
This works great in 2007. However, we now have some users who are on Office 2013 and the same code no longer works.
Dim myWd As Object
myWd.Documents.Open strDocPath, , True 'strDocPath is the path to the file
.Selection.TypeText strDate 'This works in 2007, but not in 2013
Set wdRange = .Documents(strDocPath).Bookmarks("Customer").Range
wdRange.Text = strCustomer 'Again, this doesn't work in 2013
Has anyone encountered this before? I don't know if I need to modify my Word document or my VBA code.
"The face of a child can say it all, especially the mouth part of the face." - Jack Handey