View Single Post
  #1   Report Post  
Posted to microsoft.public.word.tables
Brett Shearer Brett Shearer is offline
external usenet poster
 
Posts: 1
Default Automation returns incorrect data (Threading.Thread.Sleep fixes)

I am reading large word documents to create c# source files and need to use
the texture of a cell to separate the data I need.

Without the sleep command the cell shading texture is not always returns
correctly.
Is there a better (correct) way to handle this?

if (identifier.StartsWith("Record Identifier"))
{
if (table.Cell(1, 1).Shading.Texture != WdTextureIndex.wdTexture15Percent)
{
System.Threading.Thread.Sleep(1000);
}
if (table.Cell(1, 1).Shading.Texture == WdTextureIndex.wdTexture15Percent)
{
ProcessTable(table);
}
}