 | Senior Member with 151 posts. | | Join Date: Apr 2007 Location: Seattle, WA Experience: Flash Guru - VBA.... still learning | | 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 12:38 AM.
| | Senior Member with 151 posts. | | Join Date: Apr 2007 Location: Seattle, WA Experience: Flash Guru - VBA.... still learning | | 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 | | Senior Member with 151 posts. | | Join Date: Apr 2007 Location: Seattle, WA Experience: Flash Guru - VBA.... still learning | | 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 | | Senior Member with 151 posts. | | Join Date: Apr 2007 Location: Seattle, WA Experience: Flash Guru - VBA.... still learning | | 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 | | Senior Member with 151 posts. | | Join Date: Apr 2007 Location: Seattle, WA Experience: Flash Guru - VBA.... still learning | | 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 | | Distinguished Member with 9,329 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer | | Red, have you also looked at the Split() function for parsing the String? | | Senior Member with 151 posts. | | Join Date: Apr 2007 Location: Seattle, WA Experience: Flash Guru - VBA.... still learning | | Hmmm not yet...looking now tho Thanks for the tip I searching on it now... | | Senior Member with 151 posts. | | Join Date: Apr 2007 Location: Seattle, WA Experience: Flash Guru - VBA.... still learning | | 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... | | Senior Member with 151 posts. | | Join Date: Apr 2007 Location: Seattle, WA Experience: Flash Guru - VBA.... still learning | | OBP the split() function does look like it would work - I am trying some examples today and Ill let you know how it goes... | | Distinguished Member with 9,329 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer |
04-Nov-2009, 09:30 AM
#10 | | | | Senior Member with 151 posts. | | Join Date: Apr 2007 Location: Seattle, WA Experience: Flash Guru - VBA.... still learning |
04-Nov-2009, 09:56 AM
#11 | OBP - thanks ill try to work with this sample | |
Smart Search
| Find your solution! | |
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.
| You Are Using: |
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 02:13 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd. | |
|