+ Reply to Thread
Results 1 to 3 of 3

Display Word Paragraphs in Excel???

  1. #1
    quartz
    Guest

    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. #2
    Dick Kusleika
    Guest

    Re: 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:\****\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.

    --
    **** Kusleika
    Excel MVP
    Daily Dose of Excel
    www.*****-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. #3
    quartz
    Guest

    Re: Display Word Paragraphs in Excel???

    ****,

    Thanks so much, this is very helpful.

    "**** 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:\****\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.
    >
    > --
    > **** Kusleika
    > Excel MVP
    > Daily Dose of Excel
    > www.*****-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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1