다음 코드는 .csv 파일로 출력되어야합니다.
참고! 첫째, 마이크로 소프트 스크립팅 런타임 DLL (Scrrun.dll에)에 대한 참조를 추가하십시오 : 도구 - VBA를 창에서
> References-> (DLL 여기
작동 코드는 마이크로 소프트 런타임 스크립팅을 수행 할 수 있습니다 확인) 매크로 만들고 그 안에 코드를 삽입 :
Dim wordsArray, arrayElement
Dim delimiter As String
Dim fileName As String
Dim fso As FileSystemObject
Dim outputFile As textStream
'select all document's content
ActiveDocument.Select
'provide delimiter
delimiter = InputBox("Please enter delimiter to use")
'split the selected content and place it inside the array
wordsArray = Split(Selection.Text, delimiter)
'generate output file name
fileName = "C:\Output.csv"
'create new FileSystem object and open text stream to write to
Set fs = New FileSystemObject
Set outputFile = fs.CreateTextFile(fileName, True) 'note file will be overwritten
'iterate through array and write to the file
For Each arrayElement In wordsArray
'Use the following code to place each word into separate COLUMN
'outputFile.Write (arrayElement) & ","
'Use the following code to place each word into separate ROW
outputFile.WriteLine (arrayElement)
Next
'close output stream
outputFile.Close
당신은 당신의 필요에 따라이를 완화 할 수 ...이 도움이
희망을.
Word 문서 나 다른 곳에서 모든 텍스트를 복사 하시겠습니까? 당신은 "단일 열"csv 파일을 언급하지만 Access 테이블 설명은 다중 열처럼 보입니다 ... –
MS Access 데이터베이스를 사용할 때 테이블 당 최대 255 개의 열이 기억됩니다). –