![how do i underline in word without text how do i underline in word without text](https://i1.wp.com/www.myofficetricks.com/wp-content/uploads/2019/06/062819_0834_4WaystoUnde1.png)
ORange.InsertAfter(CHR(9) + CHR(9)+ ALLTRIM(PROPER(add03))+ ORange.InsertAfter("Site: " + CHR(9) + CHR(9)+ ALLTRIM(PROPER(add01))+
#How do i underline in word without text how to#
RE: Word automation - How to underline text Tore Bleken (Programmer) 31 Aug 17 15:44ĬODE -> COPY FILE SYS(5)+SYS(2003)+"\longquotes\default.doc" TO ĪLLTRIM(mqlongquote)+"\"+mqlongquote+'.doc' I'm also not the only expert here and others can get the idea what to address. Besides, when I say I took a glimpse at your code, it's likely indicating I'm short of time spending on this. Is that really harsh? You're blaming me of an offense I never made, I just ponit out the most important misunderstanding, that alone should help. Word has many collections, paragraphs, sentences, words. This object model stays the same, whether you program it Word internally via VBA basic or in VFP automation. Start up the Word help and look into it's VBA Object Reference.
#How do i underline in word without text code#
Your code already targets a smaller type of ranges, pragraphs. The only reason I don't chink out "the code" necessary is simply not knowing what you need exactly, so you need to dig deeper on your own here a bit more. And once you're pointed to that you can find out what a range is in Word and how you can get at smaller ranges than the whole document. I just point out you naturally act on the whole document, by the mere meaning of the natural english word range. RE: Word automation - How to underline text Olaf Doschke (Programmer) 31 Aug 17 15:36
![how do i underline in word without text how do i underline in word without text](https://www.howtogeek.com/wp-content/uploads/2018/12/stock-lede-microsoft-office-word-1.png)
Visual FoxPro articles, tips and downloads If Tamar (or anyone else) contradicts what I have just written, the chances are that they are right and I am wrong.
![how do i underline in word without text how do i underline in word without text](https://cdn4syt-solveyourtech.netdna-ssl.com/wp-content/uploads/2022/01/how-to-remove-underline-word-for-office-365-1.jpg)
But at least I hope it will help you understand what is going on.įinal word. Either way, that should give you the new range, which you can then underline as explained above. Or perhaps execute the Find method to find the text.
![how do i underline in word without text how do i underline in word without text](https://i.ytimg.com/vi/Wtf77ZuP19I/mqdefault.jpg)
If all else fails, you could loop through the document's Sentences collection, looking for a sentence that contains the specified text. There should be a way of starting a new range at the insertion point, and ending it at another arbitrary point, but I can't think how to do that. So the question is: how do you create that new range? That's where my knowledge is lacking. There should be no need to set it back to zero. You then set the Font.Underline of that new range (oRange1) to 1. Note that that will be a different variable (e.g. What you want to do is to get a new range object, covering only the sentence ""Description of proposed works". Setting it back to zero will remove the underlining from the whole document. When you set the range's underline property to 1, that setting will apply to the whole document. Each time you insert new text, or a new paragraph mark, the range is extended, so it still covers the whole document. That's because you initially set it to oDocument.Range(). The problem is that oRange refers to the entire document. I understand what is going wrong, but I'm not sure how well I can explain it. Steve RE: Word automation - How to underline text Olaf Doschke (Programmer) 31 Aug 17 14:43 ORange.InsertAfter("Description of proposed works") & THIS IS THE LINE I WANT UNDERLINEDĪs mentioned, I have tried putting the line = 1 in different places but either all text or no text are underlined. ORange.InsertAfter("Subject: " +CHR(9) + ALLTRIM(LEFT(UPPER(qsubject),1))+ ĪLLTRIM(RIGHT(LOWER(qsubject),LEN(qsubject)-1))) ORange.InsertAfter(CHR(9) + CHR(9)+ ALLTRIM(PROPER(msadd02))+", "+ ĪLLTRIM(PROPER(msadd03))+" "+ALLTRIM(UPPER(mspcode))) ORange.InsertAfter("Site: " + CHR(9) + CHR(9)+ ALLTRIM(PROPER(sadd01))+ ORange.InsertAfter("Client: " + CHR(9) + CHR(9)+ qpropcust) ORange.InsertAfter("Date: " + CHR(9) + CHR(9)+ DTOC(quotedate)) ORange.InsertAfter("Quote Ref: " + CHR(9) + qlongquote)