Vb.Net MS Publisher 字符串数组到文本框问题
我正在创建一个简单的发布应用程序,其中我需要从字符串数组中的不同文本框中插入文本。我已经像这样编码了。
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 个索引)填充第一个文本框,其余文本框包含空字符串,尽管文本数组有值。
任何帮助将不胜感激。
谢谢。
I am creating a Simple Publisher Application in which I need to insert texts in different textbox from an array of strings .I have coded it like this .
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
Now It only populates first text box with the first string in the array (For 0th index) and rest textboxes contains empty strings ,though texts array has values.
Any help would be highly appreciated .
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将代码更改为 C#,现在工作正常......!!
Changed the code to C# and its working fine now...!!