![]() |
#1
|
|||
|
|||
![]()
Hello, I am in Excel VBA UserForm. I have a long string text containing lots of chr(10) and chr (13) and I need to sent this string to a Word file. However after I sent I found lots of blank lines in the Word document and I had to manually "select all" and do "reduce the space between rows". Later I added a code to select the whole text in Word, but I don't know how to use "WholeStory" method to delete all these blank rows in the selected text. My code is as below (in Excel VBA):
Private Sub ScopeSendToWord Dim objWordFile As Word.Application Set objWordFile = New Word.Application objWordFile.Documents.Add objWordFile.ActiveDocument.Range.Text = txtScope (txtScope is a string text which I want to export to a Word file, the code works and I can see the content in Word file) objWordFile.ActiveDocument.Range.Select (selecting text in Word file) Selection.WholeStory (this is the code I added but I can't get through and I need help here) objWordFile.Visible=True End Sub Thank you so much. Jason |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error: "Changes made were lost...reconnect with server", when switching "from" field | randhurrle | Outlook | 2 | 02-25-2015 06:51 PM |
When composing an e-mail how do I add "Page Layout" and "View" tabs to the ribbon | CensorTilSin | Outlook | 1 | 12-11-2013 12:05 PM |
help with compatibility of "WdSaveFormat" property of SaveAs method | ajetrumpet | Word | 0 | 07-15-2013 07:29 AM |
Method to active "Select Drawing Objects" | rgustin | Word VBA | 1 | 08-18-2012 11:58 AM |
![]() |
Jamal NUMAN | Word | 2 | 07-03-2011 03:11 AM |