Results 1 to 2 of 2

Thread: Using module in another Word doc

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Location
    The Netherlands
    Posts
    3

    Using module in another Word doc

    Hey guys,

    Is there a way to create a *.dot and then use a Sub routine from another *.dot that is already opened?

    Example
    Document1.dot has a module modOpenDialog with a sub
    Sub DialogOpen ()
    frmMain.show
    End

    In a new document (document2.dot) I want to call the routine above from the document add new like:
    Private Sub Document_New()
    document1.modOpenDialg.DialogOpen
    End Sub

    Is this possible and if yes, how can I do this?

    Thanks a lot
    Eat your pie before you die & don't forget to smile!!

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    I believecan only call a sub directly if the template is loaded as a global module. But you ca use the Run method.

    VB Code:
    1. Application.Run "'document1'!modOpenDialg.DialogOpen"

    The Sub called (e.g. DialogOpen) cannot be declared as Private.

Posting Permissions

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



Click Here to Expand Forum to Full Width