ignore paragraphs within text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to export the slideIndex and the notes page ppPlaceholderBody
text from each slide to a text file (following the example here:
http://www.pptfaq.com/FAQ00274.htm) so that I can import the text file into
Excel as 2 columns. I've got the text file exported, but when I import it
into Excel, Excel interprets the paragraph returns WITHIN the notes page
ppPlaceholderBody text as the end of a record (row), which then throws off
the contents of each column.

Is there anything I can do in the text file to prevent Excel from
interpreting every paragraph return as the end of a record? Some way to
encapsulate the ppPlaceholderBody text so that it is treated as a single
entity (with or without paragraphs within)?

Or, is there any way to append the contents of a Print statement immediately
to the end of the previous Print statement contents (ie. NOT use a line
return, so that I can select something else as a record delimiter)?

Any other ideas?
 
I am trying to export the slideIndex and the notes page ppPlaceholderBody
text from each slide to a text file (following the example here:
http://www.pptfaq.com/FAQ00274.htm) so that I can import the text file into
Excel as 2 columns. I've got the text file exported, but when I import it
into Excel, Excel interprets the paragraph returns WITHIN the notes page
ppPlaceholderBody text as the end of a record (row), which then throws off
the contents of each column.

Is there anything I can do in the text file to prevent Excel from
interpreting every paragraph return as the end of a record? Some way to
encapsulate the ppPlaceholderBody text so that it is treated as a single
entity (with or without paragraphs within)?

Instead of using the placeholder text directly, assuming it's in a variable
sPHText:

Call Replace(sPHText, vbcrlf, "|")

That'd replace CR/LF pairs with a pipe symbol, for example
If you can work out what the correct linebreak character is for Excel, you
could replace CR/LF with that instead.
Or, is there any way to append the contents of a Print statement immediately
to the end of the previous Print statement contents (ie. NOT use a line
return, so that I can select something else as a record delimiter)?

Not exactly, but instead of using Print for each line you want to add to the
file, you could keep tacking new values onto the end of a string variable:

For X = 1 to 10
sText = sText & "New line, number: " & cstr(X)
' to add a new line
sText = sText & VBCrLf
Next
 
Thanks for your response. I ended up using an at sign (@) at the end of each
field and a tilde (~) at the beginning of each Print statement so that I
could distinguish those paragraph returns from the paragraph returns within
the notes body text. Then in Word I:
1. Manually removed all record paragraph returns (the ones with a ~ at the
end).
2. Found all <p> (paragaph marks) and replaced with zzz.
3. Found all zzz~ and replaced with <p> (so that now all of the record
paragraph returns are paragraph marks but the paragraphs within the notesbody
text are still zzz.)
4. Converted text to table specifying Other (@) as the field delimiter.
5. Found all zzz and replaced with <p>. (Restoring the paragraphs within the
notesbody).

It's a little convoluted, but it gave me what I need with a minimal amount
of manaul manipulation. Just thought I'd share my results.
 
Nice workaround. Word's S&R is a very useful stick to beat on this kind of problem
with. Pity we don't have anything as PowerFul in PowerPoint.
 
Back
Top