Office Macro PowerPoint extracts text to word

xiaoxiao2021-03-06  92

PowerPoint directs to the outline format Word, will lose some non-headed content text, using simple scripts to extract text to Word in the slide as possible.

This macro requires reference to the corresponding Word library.

Attribute VB_Name = "Module 1"

Sub toword ()

ON Error ResMe next

DIM A as new applibility

Dim Sl as powerPoint.slide

DIM SH as PowerPoint.Shape

DIM C as PowerPoint.View

DIM I as integer

i = 1

Dim Str As String

Str = "" "

SET C = Application.ActiveWindow.VIEW

For Each Sl in PowerPoint.AachPresentation.slides

C.GOTOSLIDE I

Str = STR "Page" VBA.STR (i) VBLF

For Each Shin Sl.Shapes

SH.SELECT

Str = str a.activeWindow.Serection.TextRange.text VBLF

Next sh

i = i 1

Str = STR "--------------------------------------------- - " VBLF

Next SL

DIM D As New Word.Application

DIM DD AS WORD.Document

D.Visible = true

D.activate

SET DD = D.Documents.Add

DD.select

Dd.words.first.text = STR

End Sub

转载请注明原文地址:https://www.9cbs.com/read-105671.html

New Post(0)