codewala

code it

Tool to convert PowerPoint to Word

Was looking for a tool which would easily convert PPT into Word. Found a nice tool to covert the PowerPoint file into Word document.

http://www.okdosoft.com/okdo-ppt-to-word-converter.htm

Features

  • Batch convert numerous Ppt format files once to save your time.
  • Preserve the original layout of your Ppt in an editable Word.
  • Support Convert Ppt to Doc/Docx/Docm by default way.
  • Support save PowerPoint page layout Mode.
  • Support extract the character of PowerPoint to convert.
  • Support convert the lantern slide content to Doc/Docx/Docm by image way.
  • Custom to set the output file name.
  • Custom the Word margin size and page size.
  • You can add the whole folder to convert.
  • Save List: Save the converted files to a list.
  • Load List: Load the saved list files directly to convert.
  • You can set to open the output folder when conversion finished.

April 26, 2011 Posted by | PowerPoint, Word | Leave a comment

Macro to import notes from PowerPoint into Word

I needed to export only the notes from PowerPoint into Word. In PowerPoint 2003, we can use “File – send to – MS Office Word” to export the PowerPoint as Word. But faced two issues with this
1. There is no option to only export notes section
2. The bullet formatting of the notes section is lost at the time of export. This issue has been resloved in MS Office 2007.

Wrote my own macro in Word which will only import the notes section from PowerPoint into Word and also retain the bullet formatting given in PowerPoint.


'-------------------------------------------------------------
Option Explicit
'
Sub ImportNotes()

' FOR WORD
Dim oDoc As Document
Dim docPath As String
Dim oTable As Table
Dim oRow As Row
' FOR POWERPOINT
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Dim ppFileName As String
Dim ppFilePath As String
Dim oSlides As Slides
Dim oSlide As Slide
Dim oShape As Shape
'
Set oDoc = ActiveDocument
Set oTable = oDoc.Tables(1)
docPath = oDoc.Path
'
ppFileName = "notes.ppt"
ppFilePath = docPath & "\" & ppFileName
'
Set ppApp = CreateObject("PowerPoint.Application")
'
ppApp.Visible = True
ppApp.Activate
'
Set ppPres = ppApp.Presentations.Open(ppFilePath)
Set oSlides = ppPres.Slides
'
For Each oSlide In oSlides
'
oTable.Rows.Add
Set oRow = oTable.Rows(oTable.Rows.Count)
oSlide.NotesPage.Shapes(2).TextFrame.TextRange.Copy
oRow.Cells(1).Range.Text = "slide " & oSlide.SlideIndex
oRow.Cells(2).Range.PasteSpecial ppPasteRTF
'
Next oSlide
'
End Sub
'-------------------------------------------------------------

January 5, 2011 Posted by | PowerPoint, VBA, Word | 5 Comments

Macro to retain paragraph formatting when text is copied from Word to PowerPoint

In my earlier post I had mentioned about paragraph formatting is lost when text is copied from Word to PowerPoint.

Wrote a macro in PowerPoint to retain the paragraph formatting of the copied text from Word to PowerPoint.


'--------------------------------------------------
Option Explicit
'
'
'
Sub CopyTextFromWordWithParaFormat()
'
' FOR WORD
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim wdFile As String
Dim oTable As Word.Table
Dim oRow As Word.Row
Dim oParas As Word.Paragraphs
Dim oPara As Word.Paragraph
Dim paraBullet()
Dim paraIndentLevel()
Dim p As Long
Dim wdParaCount As Long
Dim counter As Long
'
' FOR POWERPOINT
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Dim oSlide As Slide
Dim oShape As PowerPoint.Shape
Dim ppParaCount As Long
Dim path As String
'
' INITILIZE
Set ppApp = PowerPoint.Application
Set ppPres = ActivePresentation
path = ppPres.path
p = 1
counter = 1
wdParaCount = 0
ppParaCount = 0
'
'
'-----------------------------------------------------
' SWITCH TO WORD TO READ THE CONTENT
'-----------------------------------------------------
Set wdApp = CreateObject("Word.Application")
wdFile = path & "/" & "sample.doc"
'
Set wdDoc = wdApp.Documents.Open(wdFile)
wdApp.Visible = True
wdDoc.Activate
'
'
' READ WORD TABLE
Set oTable = wdDoc.Tables(1)
Set oRow = oTable.Rows(1)
Set oParas = oRow.Cells(1).Range.Paragraphs
'
wdParaCount = oParas.Count
'
' GET PARAFORMATTING OF EACH PARAGRAPH
ReDim paraBullet(wdParaCount)
ReDim paraIndentLevel(wdParaCount)
'
For p = 1 To wdParaCount
'
Set oPara = oParas(p)
'
' ONLY INCLUDE THOSE PARA'S WHICH ARE NOT EMPTY
If (Len(oPara.Range.Text) > 1) Then
paraBullet(counter) = oPara.Range.ListFormat.ListType
paraIndentLevel(counter) = oPara.Range.ListFormat.ListLevelNumber
counter = counter + 1
End If
'
Next p
'
'
' COPY THE TEXT FROM WORD
oRow.Cells(1).Select
SendKeys "^c", 1
'
'
'---------------------------------------------------------
' SWITCH TO POWERPOINT TO PASTE AND FORMAT THE COPIED TEXT
'---------------------------------------------------------
'
ppApp.Activate
'
With ActivePresentation
'
Set oSlide = .Slides(1)
Set oShape = oSlide.Shapes("Rectangle 3")
'
' PASTE THE TEXT COPIED FROM WORD INTO THE SHAPE
oShape.TextFrame.TextRange.Text = ""
oShape.TextFrame.TextRange.Characters(1, 0).Select
SendKeys "^v", 1
ppParaCount = oShape.TextFrame.TextRange.Paragraphs.Count
'
'
' FIRST CLEAR THE PARAGRAPH FORMATTING FROM POWERPOINT
oShape.TextFrame.TextRange.Paragraphs(1, ppParaCount).ParagraphFormat.Bullet.Type = ppBulletNone
oShape.TextFrame.TextRange.Paragraphs(1, ppParaCount).IndentLevel = 0
'
' APPLY THE WORD PARAGRAPH FORMATTING INTO POWERPOINT
For p = 1 To ppParaCount
'
If (paraBullet(p) = 2 Or paraBullet(p) = 3) Then ' 2 for bullet and 3 for numbered bullet
oShape.TextFrame.TextRange.Paragraphs(p).ParagraphFormat.Bullet.Visible = msoTrue
oShape.TextFrame.TextRange.Paragraphs(p).IndentLevel = paraIndentLevel(p) + 1
End If
'
Next p
'
End With
'
' EXIT WORD
wdDoc.Close
wdApp.Quit
'
' CLEAR ARRAY
ReDim paraBullet(0)
ReDim paraIndentLevel(0)
'
' CLEAR OBJECTS
Set oShape = Nothing
Set oSlide = Nothing
Set oPara = Nothing
Set oRow = Nothing
Set oTable = Nothing
Set wdDoc = Nothing
Set wdApp = Nothing
'
MsgBox "process complete."
'
End Sub

‘————————————————–

December 29, 2010 Posted by | PowerPoint, VBA, Word | Leave a comment

Workaround to retain the paragraph formatting of text when copied from Word to Powerpoint

While developing an automation program which will copy text from Word file into PowerPoint, came across this issue of PowerPoint not able to retain the paragraph formatting of the text. This happens when the text has mix of bulleted and non-bulleted paragraphs. It seems that PowerPoint can only retain the formatting if each paragraph in Word is bulleted. Refer the screenshots to see the issue and the workaround.

Formatted paragraph text in word

When Copied into PowerPoint

Modified paragraph text in word

When Copied into PowerPoint

December 25, 2010 Posted by | PowerPoint, Word | 1 Comment