Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Sep 2004
    Location
    Sydney, New South Wales, Australia
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Checking for macro in Normal.dot (Word 2000 sp3)

    Evening Loungers

    I have a series of forms and each form is created from its own template (.dot file). When the user has finished filling in a form it is to be converted to a PDF doc by clicking on a button on the menu bar. What I need to do is check that the 'ConvertToPDF" macro exists in the Normal.dot file (Adobe). There may be incidents where Adobe Acrobat is not installed on a computer. How do I check that the 'ConvertToPDF' macro exists in the Normal.dot template? Also am I approaching this correctly or is there a better way to do it?

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Checking for macro in Normal.dot (Word 2000 sp3)

    The problem is that if you call ConvertToPDF directly in your code, you'll get a compile error on machines where ConvertToPDF is not available.

    You could put up a warning when the form is created, in the Document_New event procedure of the templates:

    Private Sub Document_New()
    If WordBasic.MacroFileName("ConvertToPDF") = "" Then
    MsgBox "ConvertToPDF not available!", vbExclamation
    ActiveDocument.Close SaveChanges:=False
    Exit Sub
    End If
    ' other code (if needed)
    ...
    End Sub

  3. #3
    Star Lounger
    Join Date
    Sep 2004
    Location
    Sydney, New South Wales, Australia
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Checking for macro in Normal.dot (Word 2000 sp3)

    Thanks Hans

    As usual a simple and elegant solution.

    Regards

Posting Permissions

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