Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Boston, Massachusetts, USA
    Posts
    205
    Thanks
    0
    Thanked 0 Times in 0 Posts

    What type of label was used? (Word 2000 SR2)

    Okay, I need some help here.
    Create a new document based on a specific label definition (like one of the avery address labels), and you save that as a document, then go in to another document and do the same thing using a different label definition.
    Now go back into that first document. Is there anyway to tell what label definition was used?

  2. #2
    Bronze Lounger IanWilson's Avatar
    Join Date
    Dec 2000
    Location
    Bristol, United Kingdom
    Posts
    1,523
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: What type of label was used? (Word 2000 SR2)

    Probably no comfort now, but I try to record details of which Avery label I've used in the properties dialogue.

    Ian

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: What type of label was used? (Word 2000 SR2)

    Jefferson,

    Interestingly enough, if one records a macro of creating a new document of labels, the label type will be in the code. BUT, there is no separate VBA project created for the new document - not that I could find in Word 97. Is this the case in 2000 also?

    However, one could look at the document and come close to guessing which label was used by seeing how many labels across and down are on the page. If this is needed often, a reverse table lookup could be created so you could home in on the label type based on the rows and cols on a page.

    Fred

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: What type of label was used? (Word 2000 SR2)

    A lookup sounds like a massive amount of work!! The following macro will report the label dimensions, which someone could manually match with the information on the box:
    <pre>Sub LabelSniffer()
    With ActiveDocument.Tables(1)
    MsgBox "Print this document on a sheet of labels matching " & _
    "the following label dimensions:" & vbCrLf & vbCrLf & _
    (.Columns.Count + 1) / 2 & " Labels Across" & vbCrLf & _
    PointsToInches(.Cell(1, 1).Width) & " inches Wide by " & _
    PointsToInches(.Cell(1, 1).Height) & " inches Tall"
    End With
    End Sub</pre>

    I believe Word97 does not support PointToInches, so you would have to manually convert by dividing by 72:
    <pre>Sub LabelSniffer97()
    With ActiveDocument.Tables(1)
    MsgBox "Print this document on a sheet of labels matching " & _
    "the following label dimensions:" & vbCrLf & vbCrLf & _
    (.Columns.Count + 1) / 2 & " Labels Across" & vbCrLf & _
    (.Cell(1, 1).Width) / 72 & " inches Wide by " & _
    (.Cell(1, 1).Height) / 72 & " inches Tall"
    End With
    End Sub</pre>

    I think that's about as far as I would go with this...

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: What type of label was used? (Word 2000 SR2)

    <P ID="edit" class=small>Edited by jscher2000 on 08-Jun-02 14:40.</P>Turns out the information is not recoverable this way, unfortunately.

    If all else fails, you could try this: open the file using the Recover Text From Any File filter and see if it is buried in the invisible metadata.

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: What type of label was used? (Word 2000 SR2)

    Jefferson,

    Macro worked well. It turns out your 2000 macro with points to inches did work in my 97.

    Once one has the dimensions of the labels, one could match those against a table. I agree the table would take a bit of work but it's not terrible. Turns out in 97 that when you go to the options, the dialog box shows the dimensions of the label selected. So you'd need a table with 3 cols: label type, label width, and label height. A 4th col could optionally be added for the description. Using your macro that finds the dimensions, one goes into the table to find a match. Problem is there may be more than 1 match. I'd cycle thru the entire table and report out every match. Another way is to put the table into Excel and then just filter on the width and height columns.

    The only thing to do is build the table <img src=/S/grin.gif border=0 alt=grin width=15 height=15>. Something for the original poster to do. Of course, putting the label type as a custom property, as suggested, works too. If the creation of the document were being recorded, then the label type is available.

    I do have a question regarding the code:
    <pre>Sub Macro3()
    Application.MailingLabel.DefaultPrintBarCode = False
    Application.MailingLabel.CreateNewDocument Name:="2160 Mini", Address:= _
    "fred", AutoText:="ToolsCreateLabels1"
    End Sub
    </pre>


    Shouldn't one see a project for the document created by the above code (which I already observed one does not)? We are creating a new document! However, if you run the above code, it will create a new VBA project for the corresponding new document. This almost suggests to me an alternative: if one can control the Envelopes and Labels dialog to know what the selection was for the labels, one could then run the above code and capture the name, which would be input to the name property, as a custom property. No need for the table.

    Certainly beyond my capabilities.

    Fred

Posting Permissions

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