Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-27-2021, 05:03 PM
Guessed's Avatar
Guessed Guessed is offline UTF-8 Creation Windows 10 UTF-8 Creation Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Creation lahanroyal Excel 3 08-27-2019 11:10 PM
UTF-8 Creation Document Creation Caerleon Word 1 09-11-2015 07:42 PM
UTF-8 Creation Template creation Calvinclown Word 3 09-16-2014 07:19 PM
UTF-8 Creation Document Creation Privateer Word 3 06-20-2013 08:15 PM
UTF-8 Creation Label Creation speloquin Word 1 05-27-2011 03:08 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:25 AM.


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