form output

  • Thread starter Thread starter Elizabeth
  • Start date Start date
E

Elizabeth

Hi,

I have added a form to the end on my presentation where the viewer can
request more information and the info goes into a txt file. (with help
from this group, I might add) Can I get it to put the information for
each user on one line instead of in a column so that I can easily
import it into Excel when I'm done?

The script I have looks like this:
objTS.WriteLine "Name = " & Me.TextBox1.Text
objTS.WriteLine "Address = " & Me.TextBox2.Text
objTS.WriteLine "City St Zip = " & Me.TextBox3.Text

and comes out like this
Name = Elizabeth
Address = my street
City = Houston

I'd like it to come out like this:
Name=Elizabeth Address=my street City=Houston
Name=Next Person Address=thier street City=some town

can this be done somewhat easily?

thanks,
Elizabeth
 
Sure. Each WriteLine, writes a new line, but each & puts things together
on the same line, so you could do something like this:

objTS.WriteLine "Name = " & Me.TextBox1.Text & " Address = " &
Me.TextBox2.Text & " City St Zip = " & Me.TextBox3.Text

Note a couple of things. This is all one big long line so if the
newsreader breaks it up just keep it all on one line. Also, note the
additional ampersands (&) plus the additional spaces. This might need a
little work to get Excel to read it easily (like using TABs instead of
spaces).

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

(e-mail address removed) (Elizabeth) wrote in
 
Hi,

I have added a form to the end on my presentation where the viewer can
request more information and the info goes into a txt file. (with help
from this group, I might add) Can I get it to put the information for
each user on one line instead of in a column so that I can easily
import it into Excel when I'm done?

The script I have looks like this:
objTS.WriteLine "Name = " & Me.TextBox1.Text
objTS.WriteLine "Address = " & Me.TextBox2.Text
objTS.WriteLine "City St Zip = " & Me.TextBox3.Text

and comes out like this
Name = Elizabeth
Address = my street
City = Houston

I'd like it to come out like this:
Name=Elizabeth Address=my street City=Houston
Name=Next Person Address=thier street City=some town

can this be done somewhat easily?

What David said. But if you do this, it'll create a tab-delimited file that
will import directly into Excel:

objTS.WriteLine "Name" & vbtab & "Address" & vbtab & "City St Zip"
objTS.WriteLine Me.TextBox1.Text & vbtab & Me.TextBox2.Text ...etc.

(Hint: rename the text boxes to something like txtName and it'll be easier to
read and write code like Me.txtName.Text, Me.txtAddress.Text and so on)

If multiple users will use the same setup, you'd want instead to write the
Name, Address, etc. column headers out the first time the output file's opened,
then when writing out user data, open the file for Append and tack on just the
current user's name/rank/serial number and all.






--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
Back
Top