![]() |
#2
|
||||
|
||||
![]()
It's quite easy, really:
Code:
Sub GetData() Application.ScreenUpdating = False Dim strFolder As String, strFile As String Dim wdDocSrc As Document, wdDocTgt As Document strFolder = GetFolder If strFolder = "" Then Exit Sub Set wdDocTgt = ActiveDocument strFile = Dir(strFolder & "\3-ABC-DE-*.docx", vbNormal) While strFile <> "" If strFolder & "\" & strFile <> wdDocTgt.FullName Then Set wdDocSrc = Documents.Open(FileName:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False) With wdDocSrc If .Tables.Count > 0 Then wdDocTgt.Paragraphs.Last.Range.FormattedText = .Tables(1).Rows(1).Range.FormattedText End If .Close SaveChanges:=False End With End If strFile = Dir() Wend Set wdDocSrc = Nothing: Set wdDocTgt = Nothing Application.ScreenUpdating = True End Sub Function GetFolder() As String Dim oFolder As Object GetFolder = "" Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0) If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path Set oFolder = Nothing End Function
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
word 2010, word vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Joey Cheung | Word Tables | 1 | 08-12-2014 05:15 PM |
![]() |
AngieS | Word Tables | 1 | 09-29-2013 06:09 PM |
OneNote - Copy and paste image to the table | MartinK | OneNote | 0 | 09-03-2013 05:08 AM |
Copy and paste table | Patrickjm | Word | 1 | 03-19-2013 03:30 PM |
![]() |
flds | Word VBA | 40 | 07-16-2011 07:34 AM |