PDA

View Full Version : Open word document



rodtt
07-31-2013, 01:47 PM
Hi to all!
I have a silple need:
I need a macro to open a word document, execute mailmerge and update a excel link inside this document.
If possible, I don't want it ask me if I want to update link and mailmerge, just open it and automaticaly do those changes.
Thanks in advance

Doug Robbins
08-01-2013, 01:18 AM
See the article "Control Word from Excel” at:

http://www.word.mvps.org/FAQs/InterDev/ControlWordFromXL.htm

and also, "Early vs. Late Binding” at:

http://www.word.mvps.org/FAQs/InterDev/EarlyvsLateBinding.htm

Kenneth Hobs
08-01-2013, 07:25 AM
It is easier to help if you include simple example files.

That is not all that simple. It should be easier if you review my mail merge example files, last link in mail merge. The updating link part would be needed.
Option Explicit
'TypeText method
' http://www.excelforum.com/excel-programming/650672-populate-word-document-from-excel.html#post1946784
' http://www.excelforum.com/showthread.php?p=1946784
' http://vbaexpress.com/forum/showthread.php?p=169877
' http://vbaexpress.com/forum/showthread.php?t=24693
' http://www.excelforum.com/excel-programming/791302-excel-to-word-paragraph-and-page-setup.html

'Copy from Excel, paste to Word
'Lucas, http://vbaexpress.com/forum/showthread.php?p=178364

'FormFields
' http://www.mrexcel.com/forum/showthread.php?p=1639696
' http://www.mrexcel.com/forum/showthread.php?t=333200
' http://www.excelforum.com/excel-programming/799070-import-text-fields-from-word.html
' Content Controls
' http://www.vbaexpress.com/forum/showthread.php?t=39654

'Add Hyperlink to Bookmark
' http://www.excelforum.com/excel-programming/664078-use-excel-vba-to-add-a-hyperlink-to-a-word-document.html#post2006430
'Steiner, http://www.vbaexpress.com/kb/getarticle.php?kb_id=126
'Colin_L, http://www.mrexcel.com/forum/showthread.php?t=358054

'Save OLEObject as MSWord Document
' http://vbaexpress.com/forum/showthread.php?t=21619
' http://vbaexpress.com/forum/showthread.php?t=24292
' http://www.excelforum.com/excel-programming-vba-macros/940687-excel-export-to-ole-object-with-user-prompted-saveas-help.html?p=3336342

'Add Table to MSWord
' http://vbaexpress.com/forum/showthread.php?t=23975
' http://vbaexpress.com/forum/showthread.php?p=168731

'Import Word Tables
'vog, http://www.mrexcel.com/forum/showthread.php?t=382541
'Ruddles, http://www.mrexcel.com/forum/showthread.php?t=524091

'snb, Word Tables
' http://www.vbaexpress.com/forum/showthread.php?t=45520
' http://www.vbaexpress.com/forum/showthread.php?t=46472


'Get Optionbutton info from MSWord DOC
' http://vbaexpress.com/forum/showthread.php?t=22454

'FindReplace Text
' http://www.excelforum.com/excel-programming/682014-replace-word-in-ms-word-with-varable-from-ms-excel.html
' http://www.vbaexpress.com/forum/showthread.php?t=38958
' http://www.vbaexpress.com/forum/showthread.php?p=250215
' http://www.vbaexpress.com/forum/showthread.php?t=42833
' http://support.microsoft.com/kb/240157
' http://word.tips.net/T001833_Generating_a_Count_of_Word_Occurrences.html

' http://www.excelforum.com/excel-programming/794297-struggling-with-a-find-replace-macro-to-word.html

'Bookmarks
' http://vbaexpress.com/forum/showthread.php?p=185718
'Colin_L, http://www.mrexcel.com/forum/showthread.php?t=358054
' http://www.vbaexpress.com/forum/showthread.php?p=253277

'Mail Merge
' http://www.excelforum.com/excel-programming/796614-mail-merge-from-excel.html
' http://www.excelforum.com/excel-programming/798299-print-mail-merge-document.html
'Word 's Catalogue/Directory Mailmerge facility (the terminology depends on the Word version). _
To see how to group records with any mailmerge data source supported by Word, _
check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial at:
' http://lounge.windowssecrets.com/index.php?showtopic=731107
' or
' http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip
' Mail Merge from Excel to MSWord: ElephantsRus
' https://app.box.com/s/0zlydxinl10t23mifkrr

rodtt
08-01-2013, 02:27 PM
Thanks for the replies.
I don't want to sound lazy, but those links seem a lot of work for something I think is simple (I'm really inexperienced on VBA and excel in general).
I guess I didn't express myself very well.
My word document is done, with mergefields set and working, as the spreadsheet link.
WHat I need is a macro to open this word document and execute the merge and excel link that are already set up.

rodtt
08-18-2013, 09:41 AM
Still with this problem...

Kenneth Hobs
08-18-2013, 10:30 AM
I gave you the solution. I don't know how much more simple that can be. Simply look at snb's reply in the first mail merge link that I gave you.