Vb.Net MS Publisher字符串数组到文本框问题
我正在创建一个简单的Publisher应用程序,其中我需要从字符串数组中插入不同文本框中的文本Vb.Net MS Publisher字符串数组到文本框问题,vb.net,vba,textbox,ms-office,publisher,Vb.net,Vba,Textbox,Ms Office,Publisher,我正在创建一个简单的Publisher应用程序,其中我需要从字符串数组中插入不同文本框中的文本 Dim texts(40) As String 'Array of strings to be inserted shpTextBox = appPub.ActiveDocument.Pages(pageIndex).Shapes.AddTextbox _ (Orientation:=PbTextOrientation.pbTextOrientationHori
Dim texts(40) As String 'Array of strings to be inserted
shpTextBox = appPub.ActiveDocument.Pages(pageIndex).Shapes.AddTextbox _
(Orientation:=PbTextOrientation.pbTextOrientationHorizontal, _
Left:=pbShape.Left - 20, Top:=pbShape.Top, _
Width:=72, Height:=18)
'add text
shpTextBox.TextFrame.TextRange.Text = texts(Index)'Problem here , Only First array value is populating to very first text box , rest are empty strings.
Index = Index + 1
现在,它只使用数组中的第一个字符串(对于第0个索引)填充第一个文本框,其余文本框包含空字符串,尽管文本数组有值
任何帮助都将不胜感激
谢谢。将代码更改为C#,现在工作正常了 您在顶部有文本(40),但您在文本框中输入的是打字文本。澄清?谢谢你指出,它的文本(索引)。。!!我已经编辑过了,谢谢。现在正在寻找解决方案。。!!是否只有一个文本框,或者您是否也在循环中创建该文本框?