Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-23-2023, 01:40 AM
soroush.kalantari soroush.kalantari is offline How to to automatically update Word links with Mail Merge, when opening Word file from Excel? Windows 10 How to to automatically update Word links with Mail Merge, when opening Word file from Excel? Office 2016
Competent Performer
How to to automatically update Word links with Mail Merge, when opening Word file from Excel?
 
Join Date: Jun 2021
Posts: 115
soroush.kalantari is on a distinguished road
Default How to to automatically update Word links with Mail Merge, when opening Word file from Excel?

I have used the “Mail Merge” to link excel cells to word document. Whenever I open the word document with Mail Merge, a box is opened and when I say “yes”, all the links are updated. I have written following macro in the Excel file to open word document from Excel and do some modifications on it.
My problem is that when I open the word document from Excel , this box is not displayed and the Excel links are not updated in the Word document. Can you guide me how can I modify this macro to automatically update Word links when opening the Word document?



Sub OpenWord()


Dim oAPP As Object

Set oAPP = CreateObject(Class:="Word.Application")

oAPP.Visible = True

oAPP.Documents.Open Filename:="D:\kalantari\valuation\contract.templat e\word\mail02.docm"
oAPP.Visible = True

oAPP.Run "macro4"

oAPP.Run "unlinkheader"

End Sub
Attached Images
File Type: png sqr.comment.PNG (8.6 KB, 10 views)

Last edited by soroush.kalantari; 05-23-2023 at 05:18 AM.
Reply With Quote
  #2  
Old 05-23-2023, 11:36 PM
gmayor's Avatar
gmayor gmayor is offline How to to automatically update Word links with Mail Merge, when opening Word file from Excel? Windows 10 How to to automatically update Word links with Mail Merge, when opening Word file from Excel? Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You can suppress the message -see the Word macro to toggle the registry setting at Word VBA examples. However I doubt that this will affect the issue. See the macro suggested at Update linked fields in Word document from Excel VBA - Stack Overflow to address that.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Tags
link, mail merge, update



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel to Word - mail merge Birthday field takes ap to a month to update. bobinmil Mail Merge 0 09-26-2021 10:16 AM
How to to automatically update Word links with Mail Merge, when opening Word file from Excel? Links from word to excel not updating automatically PWindsor Word 1 02-17-2019 01:36 PM
Update & Unlink Specific Merge Field in Word Doc from Mail Merge - Excel VBA RMerckling Mail Merge 16 05-17-2018 05:19 PM
Word updating Excel links automatically Bob Loblaw Word 0 02-11-2015 06:26 AM
Can Word automatically do "Finish and Merge" after opening file? DaveBF Mail Merge 1 09-14-2011 07:56 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft