when multiple word objects are running

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • philipl@vistatec.ie

    when multiple word objects are running

    hi,

    I have a program which waits for batches documents to be dropped into
    a folder, once this happens, a class which activates the word object
    is instaniated per batchg of docs & a number of things such as
    spellchecking grammer checking etc are done. When one batch(containin g
    one or more docs) is dropped in, everything works fine, but when
    multple batches are dropped in(ie many classes of the same class are
    instaniated, weird things starts to happen. For example it complains
    about custom dictionary not available, or exceptions are generated
    when the ends of arraylists are reached.

    Does anyone know why this is happening & what I can do to solve this?

    thx
    -Philip
  • Peter Torr \(MS\)

    #2
    Re: when multiple word objects are running

    <philipl@vistat ec.ie> wrote in message
    news:a3f6c32f.0 310160922.711f5 ef7@posting.goo gle.com...[color=blue]
    > I have a program which waits for batches documents to be dropped into
    > a folder, once this happens, a class which activates the word object
    > is instaniated per batchg of docs & a number of things such as
    > spellchecking grammer checking etc are done. When one batch(containin g
    > one or more docs) is dropped in, everything works fine, but when
    > multple batches are dropped in(ie many classes of the same class are
    > instaniated, weird things starts to happen. For example it complains
    > about custom dictionary not available, or exceptions are generated
    > when the ends of arraylists are reached.[/color]

    Hi,

    Is this program running as a service, or is it on an interactive desktop?
    Office is not supported in server / service scenarios.

    How do you connect to the Word object? Do you create a new instance, or try
    to attach to a running instance? I imagine that you are creating multiple
    WinWord processes and they are having problems accessing shared resources
    because they're not really designed to be automated from two places at once.

    Can you modify your code to ensure that only one instance of Word is ever
    started up? Also if you are creating threads to handle each document or
    other tricky things like that then Word will get upset at you.

    Peter

    --
    Please post questions to the newsgroup - everyone benefits.
    This post is provided "AS IS" with no warranties, and confers no rights
    Sample code subject to http://www.microsoft.com/info/cpyright.htm
    Bore yourself to tears -- http://blogs.gotdotnet.com/ptorr


    Comment

    • philipl@vistatec.ie

      #3
      Re: when multiple word objects are running

      "Peter Torr \(MS\)" <ptorr@microsof t.com> wrote in message news:<OyhjSS$lD HA.1728@TK2MSFT NGP09.phx.gbl>. ..[color=blue]
      > <philipl@vistat ec.ie> wrote in message
      > news:a3f6c32f.0 310160922.711f5 ef7@posting.goo gle.com...[color=green]
      > > I have a program which waits for batches documents to be dropped into
      > > a folder, once this happens, a class which activates the word object
      > > is instaniated per batchg of docs & a number of things such as
      > > spellchecking grammer checking etc are done. When one batch(containin g
      > > one or more docs) is dropped in, everything works fine, but when
      > > multple batches are dropped in(ie many classes of the same class are
      > > instaniated, weird things starts to happen. For example it complains
      > > about custom dictionary not available, or exceptions are generated
      > > when the ends of arraylists are reached.[/color]
      >
      > Hi,
      >
      > Is this program running as a service, or is it on an interactive desktop?
      > Office is not supported in server / service scenarios.
      >
      > How do you connect to the Word object? Do you create a new instance, or try
      > to attach to a running instance? I imagine that you are creating multiple
      > WinWord processes and they are having problems accessing shared resources
      > because they're not really designed to be automated from two places at once.
      >
      > Can you modify your code to ensure that only one instance of Word is ever
      > started up? Also if you are creating threads to handle each document or
      > other tricky things like that then Word will get upset at you.
      >
      > Peter[/color]


      Hi Peter,

      I presume it's a service scenaro, as no interaction is expected.

      I create an instance of the word object per batch of documents. Must I
      process all these documents sequentially? Is there no way I can
      multitask this?

      thx
      -Philip

      Comment

      • Peter Torr \(MS\)

        #4
        Re: when multiple word objects are running

        <philipl@vistat ec.ie> wrote in message
        news:a3f6c32f.0 310220305.75e8f b5a@posting.goo gle.com...[color=blue]
        > I create an instance of the word object per batch of documents. Must I
        > process all these documents sequentially? Is there no way I can
        > multitask this?[/color]

        No, you can only call into the Word OM on the main thread (and any calls
        from other threads will be marshalled to the main thread).

        Peter

        --
        Please post questions to the newsgroup - everyone benefits.
        This post is provided "AS IS" with no warranties, and confers no rights
        Sample code subject to http://www.microsoft.com/info/cpyright.htm
        Bore yourself to tears -- http://blogs.gotdotnet.com/ptorr


        Comment

        Working...