Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Guys,

I have windows application with Microsoft word interoperability c#.

This application is used to Evaluate Actions done in ms-word by a user.

I have to create one template to Evaluate Paragraph TabStops used in the word document.

What I have tried:

wordApplication.ScreenUpdating = false;
WordInterop.WdAlertLevel displayAlertLevel = wordApplication.DisplayAlerts;
wordApplication.DisplayAlerts = WordInterop.WdAlertLevel.wdAlertsNone;

WordInterop.Document wordDocument = wordApplication.Documents.Open(filename);

bool result = false;

WordInterop.Range range = wordDocument.Paragraphs[paragraph].Range;
WordInterop.Paragraph wdParagraph = wordDocument.Paragraphs[paragraph];

var abc = wordDocument.Paragraphs[paragraph].Format.TabStops;
foreach(WordInterop.TabStops t in abc)
{
                    t.position;// i'm not getting the position of a tabstop
                    if(t.position == 1.5)
                           result = true;
}
               
                    
                

wordDocument.Close();
return result;


I'm not able to get the position of a tabStop of a paragraph.

Can anyone please help me.

Thanks
Posted
Updated 9-Oct-18 6:36am
v2

1 solution

Replace:
foreach(WordInterop.TabStops t in abc)

with:
foreach(WordInterop.TabStop t in abc)

NB: TabStop, without the trailing "s".
TabStop Interface (Microsoft.Office.Interop.Word) | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900