[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How can I do this in delphi?

Posted on 2005-04-27
Medium Priority
Last Modified: 2010-04-05
On http://word.mvps.org/FAQs/TblsFldsFms/FastTables.htm

There is some tip on how to maximize the performence using word and ole.

I wounder how I can do this routin in delphi:

Dim oCell As Cell

Application.ScreenUpdating = False
For Each oCell In Selection.Cells
    oCell.Range.Text = "Hi there"
Next oCell
Application.ScreenUpdating = True

End Sub

If I do:

for ix := 1 to WordApp.Selection.Cells.count-1 do
  WordApp.Selection.Cells.Item(px).Range.Text:= 'aaaa';


The selection seems to be modified.

If cells.count is 5 when I start it becomes 1 after the first time
  WordApp.Selection.Cells.Item(px).Range.Text:= 'aaaa';
has run.

Question by:wqclatre
1 Comment
LVL 11

Accepted Solution

pcsentinel earned 250 total points
ID: 13875505
try something like this

      ix: integer;
      for ix := 1 to WordApp.ActiveWindow.Selection.Cells.count-1 do
          WordApp.ActiveWindow.Selection.Cells.Item(ix).Range.Text:= 'aaaa';


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month19 days, 13 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question