Word doc history

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

    Word doc history

    Hi

    My vb.net opens a word document from a word template. I am trying to find
    when the document is saved by the user so I can make a history in my vb.net
    app. Here is how I think it may work;

    Open a word doc from vb.net app, pass ref of a vb.net event handler to the
    word doc, in word, use FileSave macro to call the vb.net event handler when
    the document is saved. The vb.net event handler creates history in vb.net
    app.

    My questions are; a) Is the above viable? b) Could someone please show me
    what coding accomplishes above?

    Thanks

    Regards


  • Jezebel

    #2
    Re: Word doc history

    Try very hard to avoid having code running in two places. Debugging and
    maintenance can get very frustrating. You should be able to do it all from
    the VB end: Word, as an object, raises enough events that you can track
    what's going on:

    Dim with events WordApp as Word.Applicatio n

    That way, you don't need any code at the Word end.



    "John" <john@nospam.in fovis.co.uk> wrote in message
    news:%23lD3rj2l DHA.2772@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > Hi
    >
    > My vb.net opens a word document from a word template. I am trying to find
    > when the document is saved by the user so I can make a history in my[/color]
    vb.net[color=blue]
    > app. Here is how I think it may work;
    >
    > Open a word doc from vb.net app, pass ref of a vb.net event handler to the
    > word doc, in word, use FileSave macro to call the vb.net event handler[/color]
    when[color=blue]
    > the document is saved. The vb.net event handler creates history in vb.net
    > app.
    >
    > My questions are; a) Is the above viable? b) Could someone please show me
    > what coding accomplishes above?
    >
    > Thanks
    >
    > Regards
    >
    >[/color]


    Comment

    • John

      #3
      Re: Word doc history

      Does word 2000 support filesave event?

      Thanks

      Regards


      "Jezebel" <grocer@play.ne t> wrote in message
      news:%237E0WS4l DHA.3700@TK2MSF TNGP11.phx.gbl. ..[color=blue]
      > Try very hard to avoid having code running in two places. Debugging and
      > maintenance can get very frustrating. You should be able to do it all from
      > the VB end: Word, as an object, raises enough events that you can track
      > what's going on:
      >
      > Dim with events WordApp as Word.Applicatio n
      >
      > That way, you don't need any code at the Word end.
      >
      >
      >
      > "John" <john@nospam.in fovis.co.uk> wrote in message
      > news:%23lD3rj2l DHA.2772@TK2MSF TNGP12.phx.gbl. ..[color=green]
      > > Hi
      > >
      > > My vb.net opens a word document from a word template. I am trying to[/color][/color]
      find[color=blue][color=green]
      > > when the document is saved by the user so I can make a history in my[/color]
      > vb.net[color=green]
      > > app. Here is how I think it may work;
      > >
      > > Open a word doc from vb.net app, pass ref of a vb.net event handler to[/color][/color]
      the[color=blue][color=green]
      > > word doc, in word, use FileSave macro to call the vb.net event handler[/color]
      > when[color=green]
      > > the document is saved. The vb.net event handler creates history in[/color][/color]
      vb.net[color=blue][color=green]
      > > app.
      > >
      > > My questions are; a) Is the above viable? b) Could someone please show[/color][/color]
      me[color=blue][color=green]
      > > what coding accomplishes above?
      > >
      > > Thanks
      > >
      > > Regards
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Doug Robbins - Word MVP

        #4
        Re: Word doc history

        Hi John,

        If you create a macro with the name of one of Word's built-in commands, your
        macro will run whenever that command is executed (in place of the command)

        Please post any further questions or followup to the newsgroups for the
        benefit of others who may be interested. Unsolicited questions forwarded
        directly to me will only be answered on a paid consulting basis.

        Hope this helps
        Doug Robbins - Word MVP
        "John" <john@infovis.c o.uk> wrote in message
        news:ueZe9l8lDH A.2080@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Does word 2000 support filesave event?
        >
        > Thanks
        >
        > Regards
        >
        >
        > "Jezebel" <grocer@play.ne t> wrote in message
        > news:%237E0WS4l DHA.3700@TK2MSF TNGP11.phx.gbl. ..[color=green]
        > > Try very hard to avoid having code running in two places. Debugging and
        > > maintenance can get very frustrating. You should be able to do it all[/color][/color]
        from[color=blue][color=green]
        > > the VB end: Word, as an object, raises enough events that you can track
        > > what's going on:
        > >
        > > Dim with events WordApp as Word.Applicatio n
        > >
        > > That way, you don't need any code at the Word end.
        > >
        > >
        > >
        > > "John" <john@nospam.in fovis.co.uk> wrote in message
        > > news:%23lD3rj2l DHA.2772@TK2MSF TNGP12.phx.gbl. ..[color=darkred]
        > > > Hi
        > > >
        > > > My vb.net opens a word document from a word template. I am trying to[/color][/color]
        > find[color=green][color=darkred]
        > > > when the document is saved by the user so I can make a history in my[/color]
        > > vb.net[color=darkred]
        > > > app. Here is how I think it may work;
        > > >
        > > > Open a word doc from vb.net app, pass ref of a vb.net event handler to[/color][/color]
        > the[color=green][color=darkred]
        > > > word doc, in word, use FileSave macro to call the vb.net event handler[/color]
        > > when[color=darkred]
        > > > the document is saved. The vb.net event handler creates history in[/color][/color]
        > vb.net[color=green][color=darkred]
        > > > app.
        > > >
        > > > My questions are; a) Is the above viable? b) Could someone please show[/color][/color]
        > me[color=green][color=darkred]
        > > > what coding accomplishes above?
        > > >
        > > > Thanks
        > > >
        > > > Regards
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Jezebel

          #5
          Re: Word doc history

          It fires the DocumentBeforeS ave and DocumentBeforeC lose events amongst
          others.




          "John" <john@nospam.in fovis.co.uk> wrote in message
          news:ueZe9l8lDH A.2080@TK2MSFTN GP10.phx.gbl...[color=blue]
          > Does word 2000 support filesave event?
          >
          > Thanks
          >
          > Regards
          >
          >
          > "Jezebel" <grocer@play.ne t> wrote in message
          > news:%237E0WS4l DHA.3700@TK2MSF TNGP11.phx.gbl. ..[color=green]
          > > Try very hard to avoid having code running in two places. Debugging and
          > > maintenance can get very frustrating. You should be able to do it all[/color][/color]
          from[color=blue][color=green]
          > > the VB end: Word, as an object, raises enough events that you can track
          > > what's going on:
          > >
          > > Dim with events WordApp as Word.Applicatio n
          > >
          > > That way, you don't need any code at the Word end.
          > >
          > >
          > >
          > > "John" <john@nospam.in fovis.co.uk> wrote in message
          > > news:%23lD3rj2l DHA.2772@TK2MSF TNGP12.phx.gbl. ..[color=darkred]
          > > > Hi
          > > >
          > > > My vb.net opens a word document from a word template. I am trying to[/color][/color]
          > find[color=green][color=darkred]
          > > > when the document is saved by the user so I can make a history in my[/color]
          > > vb.net[color=darkred]
          > > > app. Here is how I think it may work;
          > > >
          > > > Open a word doc from vb.net app, pass ref of a vb.net event handler to[/color][/color]
          > the[color=green][color=darkred]
          > > > word doc, in word, use FileSave macro to call the vb.net event handler[/color]
          > > when[color=darkred]
          > > > the document is saved. The vb.net event handler creates history in[/color][/color]
          > vb.net[color=green][color=darkred]
          > > > app.
          > > >
          > > > My questions are; a) Is the above viable? b) Could someone please show[/color][/color]
          > me[color=green][color=darkred]
          > > > what coding accomplishes above?
          > > >
          > > > Thanks
          > > >
          > > > Regards
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • John

            #6
            Re: Word doc history

            I think it does not offer DocumentAfterSa ve (unless I have missed it). In
            which case I guess I will go back to my original strategy.

            Regards


            "Jezebel" <grocer@play.ne t> wrote in message
            news:%23D2BG6Bm DHA.1948@TK2MSF TNGP12.phx.gbl. ..[color=blue]
            > It fires the DocumentBeforeS ave and DocumentBeforeC lose events amongst
            > others.
            >
            >
            >
            >
            > "John" <john@nospam.in fovis.co.uk> wrote in message
            > news:ueZe9l8lDH A.2080@TK2MSFTN GP10.phx.gbl...[color=green]
            > > Does word 2000 support filesave event?
            > >
            > > Thanks
            > >
            > > Regards
            > >
            > >
            > > "Jezebel" <grocer@play.ne t> wrote in message
            > > news:%237E0WS4l DHA.3700@TK2MSF TNGP11.phx.gbl. ..[color=darkred]
            > > > Try very hard to avoid having code running in two places. Debugging[/color][/color][/color]
            and[color=blue][color=green][color=darkred]
            > > > maintenance can get very frustrating. You should be able to do it all[/color][/color]
            > from[color=green][color=darkred]
            > > > the VB end: Word, as an object, raises enough events that you can[/color][/color][/color]
            track[color=blue][color=green][color=darkred]
            > > > what's going on:
            > > >
            > > > Dim with events WordApp as Word.Applicatio n
            > > >
            > > > That way, you don't need any code at the Word end.
            > > >
            > > >
            > > >
            > > > "John" <john@nospam.in fovis.co.uk> wrote in message
            > > > news:%23lD3rj2l DHA.2772@TK2MSF TNGP12.phx.gbl. ..
            > > > > Hi
            > > > >
            > > > > My vb.net opens a word document from a word template. I am trying to[/color]
            > > find[color=darkred]
            > > > > when the document is saved by the user so I can make a history in my
            > > > vb.net
            > > > > app. Here is how I think it may work;
            > > > >
            > > > > Open a word doc from vb.net app, pass ref of a vb.net event handler[/color][/color][/color]
            to[color=blue][color=green]
            > > the[color=darkred]
            > > > > word doc, in word, use FileSave macro to call the vb.net event[/color][/color][/color]
            handler[color=blue][color=green][color=darkred]
            > > > when
            > > > > the document is saved. The vb.net event handler creates history in[/color]
            > > vb.net[color=darkred]
            > > > > app.
            > > > >
            > > > > My questions are; a) Is the above viable? b) Could someone please[/color][/color][/color]
            show[color=blue][color=green]
            > > me[color=darkred]
            > > > > what coding accomplishes above?
            > > > >
            > > > > Thanks
            > > > >
            > > > > Regards
            > > > >
            > > > >
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            Working...