LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Change paragraph format in Word from Excel...

Okay, so yesterday I figured out how to find and replace some
information in a Word document from Excel. The information I find and
replace in Word from Excel has multiple lines - so when I'm done I
have several lines of information. I need to format this into a
numbered list. Anyone know how to change the paragraph formatting in
Word from Excel? The line of code I have doesn't seem to work so I'm
thinking I either didn't do it right or I'm missing something or I
have it in the wrong section.

Thanks in advance!

Sub EditWordDoc()
Dim wrdApp As Word.Application 'creates a dialog with Word
Dim wrdDoc As Word.Document 'creates a dialog with a document
Set wrdApp = GetObject(, "Word.Application")
wrdApp.Visible = True 'show the document
wrdApp.Activate
Set wrdDoc = wrdApp.Documents.Open("Z:\COMMON FILES\Encroachment
Permits\Permit.Tracker\Testing\testdoc.doc")
With wrdDoc.Range.Find 'Find within the document...
.Text = "aaaa" '...this text and then replace it
with...
.Replacement.Text = "Insufficient plans." & vbCr & "Other
stuff." & vbCr '...this text
.Execute Replace:=wdReplaceAll 'replace all
'.Execute Format:=wdStyleListNumber <--- this doesn't
work
End With

'clear everything and quit
'wrdApp.Quit ' close the Word application
'Set wrdDoc = Nothing
'Set wrdApp = Nothing
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
word to excel format change [email protected][_2_] Excel Programming 2 May 3rd 09 11:51 AM
how do you change the paragraph spacing in excel 2007 Fluffy Excel Discussion (Misc queries) 1 May 22nd 08 04:03 PM
Pasting Word table cell with paragraph markers into single Excel c Steve Excel Discussion (Misc queries) 1 June 16th 05 11:26 PM
Importing Word Paragraph to Excel - 1 cell, same formating -- I lose the format Chris DeNardis Excel Programming 4 February 23rd 05 04:07 PM
Pasted text from Excel to Word replaces previous paragraph TT[_2_] Excel Programming 0 January 20th 05 06:07 PM


All times are GMT +1. The time now is 08:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"