Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Appending REF Field data to a csv file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dnguyen411 - 03 Jan 2008 16:52 GMT
I'm trying to write a macro to take REF field data in MS Word and save/append
that data in a csv file.

So far, I've been able to pull the REF field data and put it in a variable
named sOutput.

(i.e. [sOutput = sInvno & ", " & sDate & ", " & sPartno & ", " & sSerno & ",
" & sDesc & ", " & sStatus & vbCr])

The output of this variable outputs each of the data points comma separated.
I want to take this data, append it to a csv file and automatically save it
without any user interaction. I haven't been able to find any code that can
help me.

Can somebody help me out?

Thanks, Davis
David Sisson - 03 Jan 2008 18:07 GMT
Sub TextFile()

Dim FileNum As Integer

FileNum = FreeFile

Open "MyData.txt" For Append As FileNum

sOutput = sInvno & ", " & sDate & ", " & sPartno & ", " & sSerno & ",
" & sDesc & ", " & sStatus & vbCr

Print #FileNum, sOutput

Close FileNum
End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.