VBA - Come faccio a inviare il comando di nuova linea (\ n) o comando tab (\ T) a un textbox.textrange.Text di una forma PowerPoint

StackOverflow https://stackoverflow.com//questions/25066225

  •  23-12-2019
  •  | 
  •  

Domanda

SlideNumber = 1
Set oPPTSlide = oPPTFile.Slides(SlideNumber)

For y = 1 To oPPTSlide.Shapes.Count
    MsgBox oPPTSlide.Shapes(y).Name
Next

With oPPTSlide.Shapes("Title 1")
    .TextFrame.TextRange.Text = _ 
               "Operations Monthly Report\n" & _
               "April " & _
               "2014"
End With
.

Questo è il codice che ho ora.Il "\ n" provoca la casella di testo che sto modificando per avviare una nuova riga.È possibile?Il codice, nel suo contesto, sta funzionando perfettamente.Il testo esatto viene inviato alla casella di testo, non due righe di testo.

È stato utile?

Soluzione

Non c'è "\ n" in VBA invece dovresti usare VBnewline o VBCRLF o VBLF

Sostituisci questo

SlideNumber = 1
Set oPPTSlide = oPPTFile.Slides(SlideNumber)

For y = 1 To oPPTSlide.Shapes.Count
    MsgBox oPPTSlide.Shapes(y).Name
Next

With oPPTSlide.Shapes("Title 1")
    .TextFrame.TextRange.Text = _ 
               "Operations Monthly Report" & VbCrLf & _
               "April " & _
               "2014"
End With
.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top