On Error Resume Next
User = Environment.UserName
Call Take_image_app.Get_file_properties()
Dim PPT As Object
Dim c = 0
Dim myDocument
PPT = GetObject(, "PowerPoint.Application")
c = PPT.presentations.count
If c > 1 Then
MsgBox("Foram encontrada mais que uma apresentação aberta, as mesmas serão fechadas")
For i = PPT.Presentations.Count To 1 Step -1
PPT.presentations.item(i).close()
Next
Open_PPT_Template()
End If
If c = 0 Then
Open_PPT_Template()
End If
PPT = GetObject(, "PowerPoint.Application")
''''''''''''''''''''''''''VAI DUPLICAR O SLIDE À APRESENTAÇÃO
Dim uNewS = PPT.ActivePresentation.Slides(PPT.ActivePresentation.slides.count - 1).Duplicate
''''''''''''''''''''''''''VAI ADICIONAR A IMAGEM AO SLIDE ANTERIOR AO DUPLICADO
myDocument = PPT.ActivePresentation.Slides(PPT.ActivePresentation.slides.count - 2)
myDocument.Shapes.AddPicture(strName, False, True, 30, 180, 660, 340)
''''''''''''''''''''''''''VAI SUBSTITUIR A INFORMAÇÃO QUE VEM NAS CAIXAS DE TEXTO
With myDocument.Shapes.Item(5).TextFrame.TextRange
.Text = "PN: " & Part_Name
.Font.Name = "Calibri (Body)"
.Font.Size = 16
End With
With myDocument.Shapes.Item(2).TextFrame.TextRange
.Text = "DESC: " & Description & " " & "MAT: " & Material & " T. TÉRMICO:" & T_Termico & " T.SUP:" & T_Superficial & " DIM:" & Dimensions
.Font.Name = "Calibri (Body)"
.Font.Size = 16
End With
With myDocument.Shapes.Item(4).TextFrame.TextRange
.Text = "COMENTÁRIOS: " & TextBox1.Text
.Font.Name = "Calibri (Body)"
.Font.Size = 16
End With
With myDocument.Shapes.Item(6).TextFrame.TextRange
.Text = "RESPONSÁVEL: " & User
.Font.Name = "Calibri (Body)"
.Font.Size = 12
End With
PPT.visible = True
IO.File.Delete(strName)