Word text formatting - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Word text formatting (/Thread-Word-text-formatting) |
Word text formatting - Rahull - 01-04-2011 Hi, I need to read the text from the word document. I am able to that... But now my requirement is to find the formatting of the searched text in word document. e.g. Word document contains text "Test" I need to find font type, Font size, Font name, Bold, Italic...etc of the text "Test" . Thanks Rahul RE: Word text formatting - Saket - 01-04-2011 use selection object for this like SelectionObject.Font.Name e.g Code: Set objWord = CreateObject("Word.Application") RE: Word text formatting - Rahull - 01-04-2011 Thanks Saket RE: Word text formatting - Rahull - 01-05-2011 I am able search text in word document using 'Find & Replace functionality" but I want to select the searched text. So that I will able to find the formatting of that text only. e.g. "This is Test" is the text available on the word document. I searched the text "Test" only and I only want to find the formatting of this word. Please advice Thanks Rahul RE: Word text formatting - Saket - 01-05-2011 if you are using Find and Replace method then when you do Find.Execute the Word Test will be selected there. you can retrieve the font info at that time RE: Word text formatting - Rahull - 01-05-2011 Saket, I tried same but It is displaying the default fonts.... E.g. Word contains "this is Rahul" but following code dispplay the formatting of "this" not "Rahul" Code: Set oWord = CreateObject("Word.Application") |