Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Display Word Paragraphs in Excel???

There are multiple Word documents that get updated. I need a method to allow
a user to instantly (or as quickly as possible) display the first 3
paragraphs from any particular Word document in Excel.

For example, in Excel user clicks "Planning Services"; then the first 3
paragraphs in the Word document "Planning Services.doc" is displayed for the
user. The user only needs to read the info, not do anything else with it.

The paragraphs are relatively short, but I'm not sure they would fit into a
MsgBox. On the other hand, I would like to avoid the hassle of developing a
user form if possible. There will be many copies of the Excel file
distributed to many users on the network.

Any suggestions? Thanks much in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Display Word Paragraphs in Excel???

quartz

A message box holds approximately 1024 characters. If your text is less
than that, you should be okay. Here's the basics of how to do it

Sub ShowParagraphs()

Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim sPara As String
Dim sFileName As String
Dim i As Long

sFileName = "C:\Dick\Ng\01 Jan\Planning Services.doc"

Set wdApp = New Word.Application
Set wdDoc = wdApp.Documents.Open(sFileName)

For i = 1 To 3
sPara = sPara & wdDoc.Paragraphs(i).Range.Text
Next i

wdDoc.Close False
wdApp.Quit

MsgBox sPara

End Sub

This is by no means instant, or even fast. You can make it faster, however,
depending on how many times it will run and some other factors.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

quartz wrote:
There are multiple Word documents that get updated. I need a method
to allow a user to instantly (or as quickly as possible) display the
first 3 paragraphs from any particular Word document in Excel.

For example, in Excel user clicks "Planning Services"; then the first
3 paragraphs in the Word document "Planning Services.doc" is
displayed for the user. The user only needs to read the info, not do
anything else with it.

The paragraphs are relatively short, but I'm not sure they would fit
into a MsgBox. On the other hand, I would like to avoid the hassle of
developing a user form if possible. There will be many copies of the
Excel file distributed to many users on the network.

Any suggestions? Thanks much in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Display Word Paragraphs in Excel???

Dick,

Thanks so much, this is very helpful.

"Dick Kusleika" wrote:

quartz

A message box holds approximately 1024 characters. If your text is less
than that, you should be okay. Here's the basics of how to do it

Sub ShowParagraphs()

Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim sPara As String
Dim sFileName As String
Dim i As Long

sFileName = "C:\Dick\Ng\01 Jan\Planning Services.doc"

Set wdApp = New Word.Application
Set wdDoc = wdApp.Documents.Open(sFileName)

For i = 1 To 3
sPara = sPara & wdDoc.Paragraphs(i).Range.Text
Next i

wdDoc.Close False
wdApp.Quit

MsgBox sPara

End Sub

This is by no means instant, or even fast. You can make it faster, however,
depending on how many times it will run and some other factors.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

quartz wrote:
There are multiple Word documents that get updated. I need a method
to allow a user to instantly (or as quickly as possible) display the
first 3 paragraphs from any particular Word document in Excel.

For example, in Excel user clicks "Planning Services"; then the first
3 paragraphs in the Word document "Planning Services.doc" is
displayed for the user. The user only needs to read the info, not do
anything else with it.

The paragraphs are relatively short, but I'm not sure they would fit
into a MsgBox. On the other hand, I would like to avoid the hassle of
developing a user form if possible. There will be many copies of the
Excel file distributed to many users on the network.

Any suggestions? Thanks much in advance.




Reply
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
How Do I Replace Paragraphs With New Paragraphs In Excel? vselin1 Excel Discussion (Misc queries) 7 July 29th 09 04:21 PM
how to format large word paragraphs into an excel file dingbat Excel Worksheet Functions 1 June 16th 09 07:14 PM
How can I enter multiple paragraphs in a single Excel cell? dclink9 Excel Discussion (Misc queries) 2 June 9th 06 10:34 PM
Moving paragraphs from MS Word to Excel [email protected] Excel Discussion (Misc queries) 3 March 2nd 05 02:36 AM
Find paragraphs in word and export to Excel Matt Shaw Excel Programming 1 July 19th 03 09:22 AM


All times are GMT +1. The time now is 01:23 AM.

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

About Us

"It's about Microsoft Excel"