cancel
Showing results for 
Search instead for 
Did you mean: 

Find the Position of text in a Word Document

RSHERRY
Staff
Staff

Hi All

 I am currently working with Word documents , I have to iterate through a large volume of word documents and check to see if any of them require a signature. 

I look for the text "Yours Sincerely" , and then i will add a text box on the line below and this text box will contain the signature. 

I have successfully added the signature but I am struggling to determine the position of the text box. 

Is there a way of finding the X and Y values of text in a Word document , so that i can add a set value to it and place the text box below the text "Yours Sincerely". 

There will only be one Signature per document. 

Any help would be greatly appreciated.

Many thanks

Rachael 



------------------------------
Rachael Sherry
------------------------------
1 REPLY 1

harish.m
MVP

Hi Rachel,

I have done in the past in  C# using code stage but unfortunatley I dont have that code any more.

But below threads might help to 

https://stackoverflow.com/questions/10165833/get-text-position-in-microsoft-word-from-vba-or-c-sharp-interop
https://learn.microsoft.com/en-us/answers/questions/647674/find-text-position-in-word-document-in-c

I would suggest to check the current MS word object in digital exchange and  check whether  using word count or line count  you can calculate the coordinates of a text.

https://digitalexchange.blueprism.com/dx/entry/3439/solution/ms-word-vbo



------------------------------
-----------------------
If I answered your query. Please mark it as the "Best Answer"

Harish Mogulluri
Lead developer
America/New_York TX
------------------------------
----------------------- If I answered your query. Please mark it as the "Best Answer" [FirstName] [LastName] [Designation] [JobTitle] [City] [State] [Phone]