Using the function of autocad vlisp to design an "Iris Mechanism".
If you want to get the full code, please email me on the following address:
[email protected]
Sub Main()
Dim PathAndName As String
Dim TextFile As Integer
Dim LineArray() As String
Dim pptLayout As CustomLayout
'Open File and read the file
PathAndName = "D:\lyrics_CE.txt"
TextFile = 1
Open PathAndName For Input As TextFile
Dim sLine As String
Dim sTextString As String
sLine = ""
sTextString = ""
Do While Not EOF(TextFile)
Input #TextFile, sLine
sTextString = sTextString & sLine
Loop
Close #TextFile
'splut the text by ";" and replace redundant tab space
LineArray() = Split(sTextString, ";")
For i = LBound(LineArray) To UBound(LineArray)
LineArray(i) = Replace(LineArray(i), vbTab, "")
Next i
'insert the text into slides
For x = LBound(LineArray) To UBound(LineArray) / 3 - 1
Set pptLayout = ActivePresentation.Slides(1).CustomLayout
Set objSlide = ActivePresentation.Slides.AddSlide(2 + x, pptLayout)
With objSlide.Shapes(2)
.Left = 0
.Top = 0
.Height = 80
.Width = 960
.Line.ForeColor.RGB = RGB(255, 255, 255)
.Line.Transparency = 1
.Fill.ForeColor.RGB = RGB(255, 255, 255)
.Fill.Transparency = 1
.Fill.BackColor.RGB = RGB(255, 255, 255)
With .TextFrame.TextRange
.text = LineArray(x * 3) & vbNewLine & LineArray(x * 3 + 1)
With .font
.Size = 30
.Name = "¼Ð·¢Åé"
.NameAscii = "¼Ð·¢Åé"
.NameOther = "¼Ð·¢Åé"
.NameFarEast = "¼Ð·¢Åé"
.Bold = True
.Color.RGB = RGB(255, 255, 0)
End With
End With
End With
With objSlide.Shapes(1)
.Left = 0
.Top = 0
.Height = 540
.Width = 50
.Line.ForeColor.RGB = RGB(255, 255, 255)
.Line.Transparency = 1
.Fill.ForeColor.RGB = RGB(255, 255, 255)
.Fill.Transparency = 1
.Fill.BackColor.RGB = RGB(255, 255, 255)
With .TextFrame
.Orientation = msoTextOrientationHorizontalRotatedFarEast
.TextRange.text = LineArray(x * 3 + 2)
With .TextRange.font
.Size = 30
.Name = "¼Ð·¢Åé"
.NameAscii = "¼Ð·¢Åé"
.NameOther = "¼Ð·¢Åé"
.NameFarEast = "¼Ð·¢Åé"
.Bold = True
.Color.RGB = RGB(255, 255, 0)
End With
End With
End With
Next x
End Sub