InsertCaption从visual basic for word table运行缓慢 [英] InsertCaption runs slowly from visual basic for word table

查看:105
本文介绍了InsertCaption从visual basic for word table运行缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个visual basic 6.5代码来读取大文本文件,并在word文档中创建表格。 大约有2100个表。 


如果我包含以下代码来创建标题,则随着更多表的添加,代码运行得越来越慢,并且essentaily在表600周围停止。 / p>

   使用选择

        .InsertCaption标签:=" Table",TitleAutoText:="",Title:= _
$
             "。  " &安培; tblTitle,Position:= wdCaptionPositionAbove,ExcludeLabel:= 0

        .Fields.Locked = True

   结束


我希望能够为表格创建目录。 另外,我想在长页的每个页面上都有标题,并且不允许行跨页。


有关如何使insertcaption工作的任何建议吗?


我正在使用


                     Selection.TypeParagraph

                    tableTitle = squadName& ":" &安培; dataName

                   使用选择

                         .TypeText"表XXX。 " + squadName +":" + dataName

                   结束


,然后插入表格标题,将表格字段复制到剪贴板,对"表格XXX"进行全局替换。使用"^ c"。


 我正在使用Word 2003,Visual Basic 6.5。

解决方案

嗨约翰,


感谢您发帖。


我会帮助您让其他人帮忙您。响应可能会有一些延迟。感谢您的耐心等待。


最诚挚的问候,


I have a visual basic 6.5 code to read a large text file, and create tables in a word document.  There are about 2100 tables. 

If I include the following code to create the caption, the code runs slower and slower as more tables are added, and essentaily stops around table 600.

    With Selection
        .InsertCaption Label:="Table", TitleAutoText:="", Title:= _
            ".  " & tblTitle, Position:=wdCaptionPositionAbove, ExcludeLabel:=0
        .Fields.Locked = True
    End With

I would like to be able to create a table of contents for the tables.  Also, I would like to have headings on every page for long tables, and do not allow rows to break across pages.

Any suggestions on how to get the insertcaption to work?

I was using

                    Selection.TypeParagraph
                    tableTitle = squadName & ": " & dataName
                    With Selection
                        .TypeText "Table XXX. " + squadName + ": " + dataName
                    End With

and then inserting a table caption, copying the table field to the clipboard doing a global replace on "Table XXX" with "^c".

 I am using Word 2003, Visual Basic 6.5.

解决方案

Hi John,

Thank you for posting.

I will help you involve others to help you. There might be some delay about the response. Appreciate your patience.

Best Regards,


这篇关于InsertCaption从visual basic for word table运行缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆