![]() |
|
#2
|
||||
|
||||
|
Something along these lines works with your sample doc
Code:
Sub RangeToCSV() Dim aRng As Range, aNewDoc As Document, sPath As String Set aRng = ActiveDocument.Tables(1).Range sPath = ActiveDocument.Path & "\" aRng.Start = ActiveDocument.Tables(1).Rows(4).Range.Start Set aNewDoc = Documents.Add aNewDoc.Range.FormattedText = aRng.FormattedText aNewDoc.Tables(1).Columns(1).Delete aNewDoc.Tables(1).ConvertToText Separator:="," aNewDoc.Paragraphs.Last.Range.Delete aNewDoc.SaveAs2 FileName:=sPath & "Test.csv", FileFormat:=wdFormatUnicodeText MsgBox aNewDoc.FullName, , "File Created" aNewDoc.Close SaveChanges:=False End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Formula Creation | lahanroyal | Excel | 3 | 08-27-2019 11:10 PM |
Document Creation
|
Caerleon | Word | 1 | 09-11-2015 07:42 PM |
Template creation
|
Calvinclown | Word | 3 | 09-16-2014 07:19 PM |
Document Creation
|
Privateer | Word | 3 | 06-20-2013 08:15 PM |
Label Creation
|
speloquin | Word | 1 | 05-27-2011 03:08 PM |