gpt4 book ai didi

VBA - 如何将新行命令 (\n) 或制表符命令 (\t) 发送到 PowerPointS 形状的 textbox.textrange.text

转载 作者:行者123 更新时间:2023-12-02 18:25:29 32 4
gpt4 key购买 nike

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

这是我现在的代码。 “\n”确实会导致我正在编辑的文本框开始一个新行。是否可以?该代码在其上下文中运行完美。不过,确切的文本会发送到文本框,而不是两行文本。

最佳答案

Vba 中没有“\n”,您应该使用 VbNewLine 或 VbCrLf 或 Vblf

替换这个

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

关于VBA - 如何将新行命令 (\n) 或制表符命令 (\t) 发送到 PowerPointS 形状的 textbox.textrange.text,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25066225/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com