Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
this seems to work Sub testword() Dim wdApp As Word.Application Set wdApp = New Word.Application argFullname = "C:\test.doc" wdApp.documents.Open Filename:=argFullname, ReadOnly:=argReadOnly wdApp.Selection.HomeKey Unit:=wdStory wdApp.Selection.MoveDown Unit:=wdParagraph, Count:=5, Extend:=wdExtend wdApp.Selection.Copy wdApp.documents(argFullname).Close SaveChanges:=False wdApp.Application.Quit Set wdApp = Nothing ThisWorkbook.Activate Sheets("Sheet4").Activate Range("A1").Select ActiveSheet.Paste Msgbox "Done" End Sub Hope this helps Cheers JulieD "quartz" wrote in message ... Does anyone know how to select the first 5 paragraphs in a Word document from Excel? I can get a ref and open the document. Now I need to select the first 5 paragraphs and copy them to the clipboard. My code so far looks like this: Dim wdApp As Word.Application Set wdApp = New Word.Application wdApp.Documents.Open Filename:=argFullName, ReadOnly:=argReadOnly <<<code to select first 5 paragraphs needed here <<<code to copy needed here wdApp.Documents(FileName).Close SaveChanges:=False wdApp.Application.Quit Set wdApp = Nothing Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How Do I Replace Paragraphs With New Paragraphs In Excel? | Excel Discussion (Misc queries) | |||
how to format large word paragraphs into an excel file | Excel Worksheet Functions | |||
Moving paragraphs from MS Word to Excel | Excel Discussion (Misc queries) | |||
Display Word Paragraphs in Excel??? | Excel Programming | |||
Find paragraphs in word and export to Excel | Excel Programming |