Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 07-30-2015, 08:21 PM
macropod's Avatar
macropod macropod is offline Append to Existing file Windows 7 64bit Append to Existing file Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,469
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

With cell referencing, you could use:
Code:
Sub Data_Append()
Dim mypath As String
mypath = ThisDocument.Path & "\log.txt"
Dim Rng As Range
Dim i As Long
Dim StrData As String
Dim filenr As Long
filenr = FreeFile
With ThisDocument.Tables(1)
  For i = 1 To 4
    Set Rng = .Cell(i, 1).Range
    With Rng
      .End = .End - 1
      StrData = StrData & "," & .Text
    End With
  Next
End With
StrData = Left(StrData, Len(StrData) - 1)
Open mypath For Append As #filenr
Print #filenr, StrData
Close #filenr
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
import outline into existing file eNGiNe PowerPoint 0 02-18-2015 05:56 AM
new style for append only thebrin Word 0 02-03-2015 06:03 PM
Append to Existing file How to append specific *.tif image with another tif file through Word VBA aarun2 Word VBA 1 04-08-2014 03:20 PM
sending data from UserForm of existing excel file to a new excel file saltlakebuffalo Excel Programming 0 02-13-2014 10:55 PM
adding a pst file to an existing pst file falcodriver Outlook 2 12-14-2011 08:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:59 PM.


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