Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    UK
    Posts
    239
    Thanks
    4
    Thanked 1 Time in 1 Post

    Export adds lines (VBA Word 2000 SR1a)

    I have a template with about 10 macros. If I view them via the VBA Editor, everything is fine. If I export the macros and create a bas file, two of the macros have some additional lines when I view the bas file via a text editor.
    For example, via the VBA Editor I would see

    Sub DisplayCoverDetails()
    ' Macro recorded by Peter Grainge
    ' Opens dialogue with previous input
    With frmReport
    .cmbDocType.Text = ActiveDocument.Variables("DocType")
    .txtTitle.Text = ActiveDocument.Variables("Title")
    .txtAuthor.Text = ActiveDocument.Variables("Author")
    .txtVersionNo.Text = ActiveDocument.Variables("VersionNo")
    .txtDate.Text = ActiveDocument.Variables("Date")
    .txtAdditional.Text = ActiveDocument.Variables("Additional")
    .Show
    End With
    End Sub

    Whereas in the text editor I would see (note extra lines at beginning, the hash symbols are mine for emphasis)

    ### Attribute VB_Name = "DisplayCoverDetails"
    Sub DisplayCoverDetails()
    ### Attribute DisplayCoverDetails.VB_Description = "Macro created 26/01/00 by Peter Grainge"
    ### Attribute DisplayCoverDetails.VB_ProcData.VB_Invoke_Func = "Normal.NewMacros.LoadReportDialog"
    ' Macro recorded by Peter Grainge
    ' Opens dialogue with previous input
    With frmReport
    .cmbDocType.Text = ActiveDocument.Variables("DocType")
    .txtTitle.Text = ActiveDocument.Variables("Title")
    .txtAuthor.Text = ActiveDocument.Variables("Author")
    .txtVersionNo.Text = ActiveDocument.Variables("VersionNo")
    .txtDate.Text = ActiveDocument.Variables("Date")
    .txtAdditional.Text = ActiveDocument.Variables("Additional")
    .Show
    End With
    End Sub

    Can someone please explain why these extra lines appear and, if appropriate, how I get rid of them.

    Many thanks

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export adds lines (VBA Word 2000 SR1a)

    There's nothing to worry about. The VBE puts those in when you export a module. They are essentially identifying attributes. Just for fun rename the first one "DisplayCoverDetails" to "DisplaySomeOtherName". Save the .bas file then import it. You'll have two identical modules except for the name.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

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