There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard netgear network printer problem ram registry repair router slow software sound toshiba trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Saving selected Notes from a PPT

Reply  
Thread Tools
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
02-Nov-2009, 03:56 PM #1
Solved: Saving selected Notes from a PPT
I have found this code , but it writes out all the notes... I want to have it select a bit of the text not all of it and save it to a file:

Sub SaveNotesText()

Dim oPres As Presentation
Dim oSlides As Slides
Dim oSlide As Slide
Dim oShapes As Shapes
Dim oSh As Shape
Dim NotesText As String
Dim FileNum As Integer
Dim PathSep As String

#If Mac Then
PathSep = ":"
#Else
PathSep = "\"
#End If

Set oPres = ActivePresentation
Set oSlides = oPres.Slides

For Each oSlide In oSlides
' NotesText = NotesText & "Slide" & oSlide.SlideIndex & vbCrLf
Set oShapes = oSlide.NotesPage.Shapes
For Each oSh In oShapes
If oSh.HasTextFrame Then
If oSh.TextFrame.HasText Then
NotesText = NotesText & oSh.TextFrame.TextRange.Text
End If
End If
Next oSh
NotesText = NotesText & vbCrLf
Next oSlide

FileNum = FreeFile
Open oPres.Path & PathSep & "NotesText.TXT" For Output As FileNum
Print #FileNum, NotesText
Close FileNum

End Sub

Last edited by Red2034; 03-Nov-2009 at 01:38 AM..
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
02-Nov-2009, 04:06 PM #2
what I would like the code to do is, select a portion of the notes and add it to a bookmark within a .doc file:

Below is an example of the notes on a slide:

010_010_030
Audio: [1]
*
Instructions:
On entry, play audio.
When user clicks on each element in the screen shot, definitions will appear as on the following pages.
When user clicks forward arrow, go to next page.

Graphics:
Image of <Add graphic description and location>

Narration:
<English>
If this is your first time using the Value University courseware, please click the <b>Launch Demonstration</b> button for a brief tour of the application.</English>
<French>Si c'est votre première fois que vous utilisez la valeur Université didacticiels, veuillez cliquer sur le bouton Lancer démonstration pour une brève visite de l'application.</French>


it should select the <English> tag and drop it into the English bookmark... is that possible???

Thanks for any help
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
03-Nov-2009, 01:34 AM #3
So, after thinking about this a bit more... I have decided to go about it different...

1. I want to access the notes and convert them to a string var
2. parse the string to only include the <English> tag
3. post that var to the bookmark in the doc

hope this makes it easier to understand, and would like to include a case statement that post the <French> tag if its not empty to the french bookmark..

thanks in advance!
Red
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
03-Nov-2009, 01:55 AM #4
I have found a delimiter function but will need to see how it works in the morning - I am headed to bed now...


Public Function parse(ByVal inString, Optional ByVal delimiters)
'Take a string, and return it as a one dimensional array
' of individual values as delimited by any of several
' characters. None of those characters are returned in
' the result. Provide a default list of delimiters, which
' should come from registry. But allow override.

Dim delimitList, oneChar, aWord, codeCount
Dim arrayCodes()

If IsMissing(delimiters) Then
'We should get these from Registry
delimitList = " ,/!|"
'Characters recognized as delimiters

Else
delimitList = delimiters
'user can override if needed
End If
Dim i, j, k
i = Len(inString)
For j = 1 To i
'Read one character at a time

oneChar = VBA.Strings.Mid(inString, j, 1)
k = InStr(delimitList, oneChar)
'Is this one a delimiter?
If k = 0 Then
aWord = aWord & oneChar
'If is isn't, add to the current word
End If
If k <> 0 Or j = i Then
'If it is, or if we're finished
If aWord > "" Then
codeCount = codeCount + 1
ReDim Preserve arrayCodes(codeCount)
arrayCodes(codeCount) = aWord
'Save new word
aWord = ""
End If
End If
Next j
parse = arrayCodes
'Return the array
End Function
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
03-Nov-2009, 11:51 AM #5
Good morning all!!! I am really excited to be back in the VBA swing of things, and excited to be solving this issue - I will post any new developments, Im sure we can solve this one today and mark it off the list!

Red
OBP's Avatar
OBP OBP is online now
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
03-Nov-2009, 12:41 PM #6
Red, have you also looked at the Split() function for parsing the String?
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
03-Nov-2009, 01:16 PM #7
Hmmm not yet...looking now tho
Thanks for the tip I searching on it now...
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
03-Nov-2009, 02:08 PM #8
Rollin - please take a look!
here is the source files im working with...

the first two functions are what saves ALL the notes and posts to a .txt file the last couple functions are the ones you and I have worked out in the past...
Attached Files
File Type: zip SaveParsedNotes.zip (172.6 KB, 1 views)
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
04-Nov-2009, 10:20 AM #9
OBP the split() function does look like it would work - I am trying some examples today and Ill let you know how it goes...
OBP's Avatar
OBP OBP is online now
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
04-Nov-2009, 10:30 AM #10
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
04-Nov-2009, 10:56 AM #11
OBP - thanks ill try to work with this sample
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
24-Nov-2009, 02:11 PM #12
I wanted to re-visit this on my week off - anybody have any other suggestions?
JohnWilson's Avatar
Computer Specs
Member with 195 posts.
 
Join Date: Nov 2007
Experience: Advanced
25-Nov-2009, 10:21 AM #13
Does any of this help?

Adapted from this page
http://www.pptalchemy.co.uk/PPT2WORD.html

Code:
Sub Notes_Word()
Dim strTag As String
Dim tagStart As Integer
Dim tagEnd As Integer
Dim WdApp As Object
Dim WdDoc As Object
Dim osld As Slide
Dim oshp As Shape
Dim strNotes As String
On Error Resume Next
strTag = InputBox("Insert Tag Name (no '<')")

'Word doc must be open
Err.Clear
Set WdApp = GetObject(Class:="Word.Application")
If Err <> 0 Then
Set WdApp = CreateObject("Word.Application")
End If


WdApp.Visible = True
Set WdDoc = WdApp.ActiveDocument
For Each osld In ActivePresentation.Slides
For Each oshp In osld.NotesPage.Shapes
If oshp.Type = msoPlaceholder Then
If oshp.PlaceholderFormat.Type = ppPlaceholderBody Then
strNotes = oshp.TextFrame.TextRange
tagStart = InStr(strNotes, "<" & strTag & ">")
tagStart = tagStart + 2 + Len(strTag)
tagEnd = InStr(strNotes, "</" & strTag & ">")
'strip out tagged section
strNotes = Mid$(strNotes, tagStart, (tagEnd - tagStart))
If strNotes <> "" Then
WdDoc.Bookmarks(strTag).Select
With WdApp.Selection
WdApp.Selection.TypeText (strNotes)
End With
End If
End If
End If

Next oshp
Next osld

End Sub
Red2034's Avatar
Computer Specs
Member with 178 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
25-Nov-2009, 01:26 PM #14
This is very slick!!!! I really appreciate the help.

So - now i want to add it to a case statement for:

English or Spanish

Thanks againg for all the help on this thread!!! To me this problem is now solved!
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:07 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.