user_glebr 发表于 2016-4-12 12:06:07

Export Power Point Note

Sub ExportNotesText() Dim oSlides As Slides Dim oSl As Slide Dim oSh As Shape Dim strNotesText As String Dim strFileName As String Dim intFileNum As Integer Dim lngReturn As Long ' Get a filename to store the collected text strFileName = InputBox("Enter the full path and name of file to extract notes text to", "Output file?") ' did user cancel? If strFileName = "" Then Exit Sub End If ' is the path valid? crude but effective test: try to create the file. intFileNum = FreeFile() On Error Resume Next Open strFileName For Output As intFileNum If Err.Number0 Then ' we have a problem MsgBox "Couldn't create the file: " & strFileName & vbCrLf _ & "Please try again." Exit Sub End If Close #intFileNum ' temporarily ' Get the notes text Set oSlides = ActivePresentation.Slides For Each oSl In oSlides For Each oSh In oSl.NotesPage.Shapes If oSh.PlaceholderFormat.Type = ppPlaceholderBody Then If oSh.HasTextFrame Then If oSh.TextFrame.HasText Then strNotesText = strNotesText & "Slide: " & CStr(oSl.SlideNumber) & vbCrLf _ & oSh.TextFrame.TextRange.Text & vbCrLf & vbCrLf End If End If End If Next oSh Next oSl ' now write the text to file Open strFileName For Output As intFileNum Print #intFileNum, strNotesText Close #intFileNum ' show what we've done lngReturn = Shell("NOTEPAD.EXE " & strFileName, vbNormalFocus)End Sub

670079340 发表于 2016-4-12 13:14:01

可以翻译成中文吗?俺E文学得不好!

user_lcsfb 发表于 2016-4-12 14:33:54

你有见过用中文写的VBA吗?

a88193485 发表于 2016-4-12 15:01:42

请问,这是做什么用的?如何使用??谢谢。

nyyd222 发表于 2016-4-12 15:30:53

导出批注的

远在远方 发表于 2016-4-12 16:19:21

哦,难怪,我运行了好几次,都是空白文档。呵呵。谢谢。

53325346 发表于 2016-4-12 16:31:10

那是做啥子的
页: [1]
查看完整版本: Export Power Point Note