简体   繁体   English

Vb.Net MS Publisher字符串数组到文本框问题

[英]Vb.Net MS Publisher Strings Array To TextBox Problem

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 . 我正在创建一个Simple Publisher Application,在其中我需要从字符串数组的不同文本框中插入文本。我已经将其编码为。

    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. 现在,它仅使用数组中的第一个字符串填充第一个文本框(对于第0个索引),而其余文本框包含空字符串,尽管texts数组具有值。

Any help would be highly appreciated . 任何帮助将不胜感激。

Thanks. 谢谢。

将代码更改为C#,现在可以正常工作了……!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM