Open an existing Word file?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CopynPaste

    Open an existing Word file?

    Hi,

    I wrote a VB.net program that import a text file, which I will parse and
    place into arrays.
    My question is how to open an existing Word file without the Dialog Box that
    has a 4x10 table and place the array[] into the table ?

    Thank you for any assistance.

    CopynPaste
  • Herfried K. Wagner [MVP]

    #2
    Re: Open an existing Word file?

    * "=?Utf-8?B?Q29weW5QYXN 0ZQ==?=" <CopynPaste@dis cussions.micros oft.com> scripsit:[color=blue]
    > I wrote a VB.net program that import a text file, which I will parse and
    > place into arrays.
    > My question is how to open an existing Word file without the Dialog Box that
    > has a 4x10 table and place the array[] into the table ?[/color]

    Without what dialog box?

    For office automation using .NET, take a look at
    <URL:http://msdn.microsoft. com/office/>.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • Bernie Yaeger

      #3
      Re: Open an existing Word file?

      Hi,

      Opening the Word file itself is easy; the harder part will be using the
      array as input for the table.

      Here's what I do: I need to select random accounts and place the current
      receivable balances for those accounts into a Word merge letter which
      displays each selected account and that account's balances. I use a sql
      server sp to zap and then create a table, containing the data I need - name,
      account #, 0-30 days, 31-60 days, etc. Then I created the Word doc and
      created a macro that loads that table into a table that displays as
      necessary, and then of course merges so that each customer has a page. When
      I run the routine, I do the sp rebuild as I mentioned above and then I call
      the Word doc and macro, thus:
      Case "welcome.do c"

      macroname_ = "/mwelcome"

      longstringname_ = globalmsopath & "\winword.e xe " & "f:\imcapps\doc s\" &
      mergeletterbox. Text & " " & macroname_

      Shell(longstrin gname_, AppWinStyle.Nor malFocus, False, -1)

      Now this opens the Word doc but not into a dialog box, as you wish. I'm
      pretty sure I could do that also, by calling it from the dialog box and
      constraining Word and a child of that dialog box (but I haven't tried that).

      HTH,

      Bernie Yaeger



      "CopynPaste " <CopynPaste@dis cussions.micros oft.com> wrote in message
      news:45DD20E3-CBE8-4EAA-B567-36ACF7430DE2@mi crosoft.com...[color=blue]
      > Hi,
      >
      > I wrote a VB.net program that import a text file, which I will parse and
      > place into arrays.
      > My question is how to open an existing Word file without the Dialog Box[/color]
      that[color=blue]
      > has a 4x10 table and place the array[] into the table ?
      >
      > Thank you for any assistance.
      >
      > CopynPaste[/color]


      Comment

      Working...