Creating .txt file from Powerpoint 2007 string variable

R

Rat-Rabbit

I would like to write the contents of a string variable in PowerPoint 2007 to
a .txt file in my Documents directory. Can anyone help me with this?
 
C

Chirag

The following code should help you get started:

Sub WriteToFile(ByVal S As String, ByVal FileName As String)
Dim FF As Long

FF = FreeFile
Open FileName For Output As FF
Print #FF, S
Close #FF
End Sub

Call it with your string variable and the full path to file name as
parameters. It will write the contents of the string variable to the file.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
K

Karl E. Peterson

Rat-Rabbit said:
I would like to write the contents of a string variable in PowerPoint 2007 to
a .txt file in my Documents directory. Can anyone help me with this?

Chirag provided a simple routine to output the text to file. If you need to find
the My Documents folder for whoever the current user is, see
http://vb.mvps.org/samples/SysFolders for a drop-in ready class that provides all
the system-defined folder locations.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top