Print Single Label in Specific Row and Column 
Author Message
 Print Single Label in Specific Row and Column

I opened the Envelops and Labels dialog through the
following VBA code:
With Dialogs(wdDialogToolsCreateLabels)
        .addrtext = "Label Text"
        .singlelabel = 1
        .labelrow = 1
        .labelcolumn = 1
        .Show
with

After the dialog is opened, I want the label to be printed
on row 3 and column 2 , so I changed Row to 3 and Column
to 2 on the dialog, then pressed Print button. But the
label was ALWAYS being printed on Row 1 and Column 1. Why
does't the dialog take user's action?

Another option is to disable the Label tab since it can't
print the label in specific row and column. How can I
disable the label tab?

thanks for help in advance!



Sat, 27 Aug 2005 05:25:28 GMT  
 Print Single Label in Specific Row and Column
Hi Hyacinth

With the addition of the word End before the final with, you code works fine
for me as long as the labels hav that many columns

If you put .Execute before the .Show, a new document will be created in
which you can see the position of the address.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP

Quote:
> I opened the Envelops and Labels dialog through the
> following VBA code:
> With Dialogs(wdDialogToolsCreateLabels)
>         .addrtext = "Label Text"
>         .singlelabel = 1
>         .labelrow = 1
>         .labelcolumn = 1
>         .Show
> with

> After the dialog is opened, I want the label to be printed
> on row 3 and column 2 , so I changed Row to 3 and Column
> to 2 on the dialog, then pressed Print button. But the
> label was ALWAYS being printed on Row 1 and Column 1. Why
> does't the dialog take user's action?

> Another option is to disable the Label tab since it can't
> print the label in specific row and column. How can I
> disable the label tab?

> thanks for help in advance!



Sat, 27 Aug 2005 17:12:04 GMT  
 Print Single Label in Specific Row and Column
Hi Doug,

I really appreciated your reply. I tried to add .Excute
method before .Show method and I did see the position the
label. But I still have the problem. Maybe I didn't
clarify my problem. My problem is, after the Envelop and
Label dialog pops up, change the row number and column
number FROM THE DIALOG, not from the VBA code. Now matter
what row & Column number I change from the dialog, the
single label is always printed in the original setting
that was set before .show method is called. I tried this
in word 97 and word 2000 and got the same result.
Please let me know if you can recreate my problem.

Please tell me that how I can disable Label tab while
enabling Envelop tab in Envelop and Label dialog since
this is my only alternative now.

thank you very much, Doug!

Quote:
>-----Original Message-----
>Hi Hyacinth

>With the addition of the word End before the final with,
you code works fine
>for me as long as the labels hav that many columns

>If you put .Execute before the .Show, a new document will
be created in
>which you can see the position of the address.

>Please respond to the newsgroups for the benefit of
others who may be
>interested.

>Hope this helps
>Doug Robbins - Word MVP


>> I opened the Envelops and Labels dialog through the
>> following VBA code:
>> With Dialogs(wdDialogToolsCreateLabels)
>>         .addrtext = "Label Text"
>>         .singlelabel = 1
>>         .labelrow = 1
>>         .labelcolumn = 1
>>         .Show
>> with

>> After the dialog is opened, I want the label to be
printed
>> on row 3 and column 2 , so I changed Row to 3 and Column
>> to 2 on the dialog, then pressed Print button. But the
>> label was ALWAYS being printed on Row 1 and Column 1.
Why
>> does't the dialog take user's action?

>> Another option is to disable the Label tab since it
can't
>> print the label in specific row and column. How can I
>> disable the label tab?

>> thanks for help in advance!

>.



Sun, 28 Aug 2005 00:05:54 GMT  
 Print Single Label in Specific Row and Column
Hi Hyacinth,

I think the only way around that problem will be to create your own dialog
using a userform.

I don't quite understand disabling the Label tab while enabling Envelop tab
in Envelop and Label dialog is your only alternative.  But if that is what
you want to do, if the userform that you create is called by a macro named
ToolsEnvelopesAndLabels, it will run in place of the command that normally
displays the Envelopes and Labels dialog.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP

Quote:
> Hi Doug,

> I really appreciated your reply. I tried to add .Excute
> method before .Show method and I did see the position the
> label. But I still have the problem. Maybe I didn't
> clarify my problem. My problem is, after the Envelop and
> Label dialog pops up, change the row number and column
> number FROM THE DIALOG, not from the VBA code. Now matter
> what row & Column number I change from the dialog, the
> single label is always printed in the original setting
> that was set before .show method is called. I tried this
> in word 97 and word 2000 and got the same result.
> Please let me know if you can recreate my problem.

> Please tell me that how I can disable Label tab while
> enabling Envelop tab in Envelop and Label dialog since
> this is my only alternative now.

> thank you very much, Doug!
> >-----Original Message-----
> >Hi Hyacinth

> >With the addition of the word End before the final with,
> you code works fine
> >for me as long as the labels hav that many columns

> >If you put .Execute before the .Show, a new document will
> be created in
> >which you can see the position of the address.

> >Please respond to the newsgroups for the benefit of
> others who may be
> >interested.

> >Hope this helps
> >Doug Robbins - Word MVP


> >> I opened the Envelops and Labels dialog through the
> >> following VBA code:
> >> With Dialogs(wdDialogToolsCreateLabels)
> >>         .addrtext = "Label Text"
> >>         .singlelabel = 1
> >>         .labelrow = 1
> >>         .labelcolumn = 1
> >>         .Show
> >> with

> >> After the dialog is opened, I want the label to be
> printed
> >> on row 3 and column 2 , so I changed Row to 3 and Column
> >> to 2 on the dialog, then pressed Print button. But the
> >> label was ALWAYS being printed on Row 1 and Column 1.
> Why
> >> does't the dialog take user's action?

> >> Another option is to disable the Label tab since it
> can't
> >> print the label in specific row and column. How can I
> >> disable the label tab?

> >> thanks for help in advance!

> >.



Sun, 28 Aug 2005 18:26:34 GMT  
 Print Single Label in Specific Row and Column
Hi Doug,

Thanks for your reply. Creating my own userform is a good
idea. Since I don't believe the userform I create will
look the same as the build in dalog, I kept trying other
alternatives before I try the userform idea. I did find a
solution. It fixed my original problem, but created a new
bug. The idea is to call Dialogs().Display method instead
of Dialogs().Show method, then call the PrintOut method of
Envelop/MailingLabel object. The following code fixed the
problem that single label can't be printed in specific row
and column. But the new bug is that the printed label only
holds the first line of .AddrText. Any idea about how to
make my solution a complete one? I am at the end of the
rope. Your help will be greatly appreciated!
Sub PrintSingleLabelTest()
    Dim myDlg As Dialog
    Dim myEnv As Envelope
    Dim myLabel As MailingLabel
    Dim lRc As Long

    Set myDlg = Dialogs
(wdDialogToolsEnvelopesAndLabels)    

    With myDlg
        .AddrText = "123 Main Street" & vbCr & "Milwaukee,
WI 12345"

        lRc = .Display
        Set myEnv = ActiveDocument.Envelope
        If lRc = 1 Then 'Print
            If .Tab = 0 Then 'envelop
                myEnv.PrintOut .ExtractAddress, _
                    .AddrText, _
                    .AddrAutoText, _
                    myEnv.DefaultOmitReturnAddress, _
                    .retaddrtext, _
                    .RetAddrAutoText, _
                    myEnv.DefaultPrintBarCode, _
                    myEnv.DefaultPrintFIMA, _
                    myEnv.DefaultSize, _
                    myEnv.DefaultHeight, _
                    myEnv.DefaultWidth, _
                    .UseEnvFeeder, _
                    .AddrFromLeft, _
                    .AddrFromTop, _
                    .RetAddrFromLeft, _
                    .RetAddrFromTop, _
                    myEnv.DefaultFaceUp, _
                    myEnv.DefaultOrientation
            ElseIf .Tab = 1 Then 'mailing label
                Set myLabel = Application.MailingLabel
                myLabel.PrintOut _
                    myLabel.DefaultLabelName, _
                    .AddrText, .ExtractAddress, _
                    myLabel.DefaultLaserTray, _
                    .SingleLabel, .LabelRow, .LabelColumn
            End If
        End If
    End With
    Set myDlg = Nothing

End Sub

Quote:
>-----Original Message-----
>Hi Hyacinth,

>I think the only way around that problem will be to

create your own dialog
Quote:
>using a userform.

>I don't quite understand disabling the Label tab while

enabling Envelop tab
Quote:
>in Envelop and Label dialog is your only alternative.  
But if that is what
>you want to do, if the userform that you create is called
by a macro named
>ToolsEnvelopesAndLabels, it will run in place of the

command that normally
Quote:
>displays the Envelopes and Labels dialog.

>Please respond to the newsgroups for the benefit of
others who may be
>interested.

>Hope this helps
>Doug Robbins - Word MVP


>> Hi Doug,

>> I really appreciated your reply. I tried to add .Excute
>> method before .Show method and I did see the position
the
>> label. But I still have the problem. Maybe I didn't
>> clarify my problem. My problem is, after the Envelop and
>> Label dialog pops up, change the row number and column
>> number FROM THE DIALOG, not from the VBA code. Now
matter
>> what row & Column number I change from the dialog, the
>> single label is always printed in the original setting
>> that was set before .show method is called. I tried this
>> in word 97 and word 2000 and got the same result.
>> Please let me know if you can recreate my problem.

>> Please tell me that how I can disable Label tab while
>> enabling Envelop tab in Envelop and Label dialog since
>> this is my only alternative now.

>> thank you very much, Doug!
>> >-----Original Message-----
>> >Hi Hyacinth

>> >With the addition of the word End before the final
with,
>> you code works fine
>> >for me as long as the labels hav that many columns

>> >If you put .Execute before the .Show, a new document
will
>> be created in
>> >which you can see the position of the address.

>> >Please respond to the newsgroups for the benefit of
>> others who may be
>> >interested.

>> >Hope this helps
>> >Doug Robbins - Word MVP

message

>> >> I opened the Envelops and Labels dialog through the
>> >> following VBA code:
>> >> With Dialogs(wdDialogToolsCreateLabels)
>> >>         .addrtext = "Label Text"
>> >>         .singlelabel = 1
>> >>         .labelrow = 1
>> >>         .labelcolumn = 1
>> >>         .Show
>> >> with

>> >> After the dialog is opened, I want the label to be
>> printed
>> >> on row 3 and column 2 , so I changed Row to 3 and
Column
>> >> to 2 on the dialog, then pressed Print button. But
the
>> >> label was ALWAYS being printed on Row 1 and Column 1.
>> Why
>> >> does't the dialog take user's action?

>> >> Another option is to disable the Label tab since it
>> can't
>> >> print the label in specific row and column. How can I
>> >> disable the label tab?

>> >> thanks for help in advance!

>> >.

>.



Tue, 30 Aug 2005 05:19:32 GMT  
 Print Single Label in Specific Row and Column
Hi Hyacinth

The problem is that the EnvelopesAndLabels dialog is only returning the
first line entered. I checked the ".AddrText" setting returned from the
dialog - it only displays the first line. It looks like a bug!

I don't know if you could kludge around this using sendkeys and Copy the
Address box contents and then get the text from the clipboard. It's getting
pretty convoluted at this point.

Cheers - Peter



Quote:
> Hi Doug,

> Thanks for your reply. Creating my own userform is a good
> idea. Since I don't believe the userform I create will
> look the same as the build in dalog, I kept trying other
> alternatives before I try the userform idea. I did find a
> solution. It fixed my original problem, but created a new
> bug. The idea is to call Dialogs().Display method instead
> of Dialogs().Show method, then call the PrintOut method of
> Envelop/MailingLabel object. The following code fixed the
> problem that single label can't be printed in specific row
> and column. But the new bug is that the printed label only
> holds the first line of .AddrText. Any idea about how to
> make my solution a complete one? I am at the end of the
> rope. Your help will be greatly appreciated!
> Sub PrintSingleLabelTest()
>     Dim myDlg As Dialog
>     Dim myEnv As Envelope
>     Dim myLabel As MailingLabel
>     Dim lRc As Long

>     Set myDlg = Dialogs
> (wdDialogToolsEnvelopesAndLabels)    

>     With myDlg
>         .AddrText = "123 Main Street" & vbCr & "Milwaukee,
> WI 12345"

>         lRc = .Display
>         Set myEnv = ActiveDocument.Envelope
>         If lRc = 1 Then 'Print
>             If .Tab = 0 Then 'envelop
>                 myEnv.PrintOut .ExtractAddress, _
>                     .AddrText, _
>                     .AddrAutoText, _
>                     myEnv.DefaultOmitReturnAddress, _
>                     .retaddrtext, _
>                     .RetAddrAutoText, _
>                     myEnv.DefaultPrintBarCode, _
>                     myEnv.DefaultPrintFIMA, _
>                     myEnv.DefaultSize, _
>                     myEnv.DefaultHeight, _
>                     myEnv.DefaultWidth, _
>                     .UseEnvFeeder, _
>                     .AddrFromLeft, _
>                     .AddrFromTop, _
>                     .RetAddrFromLeft, _
>                     .RetAddrFromTop, _
>                     myEnv.DefaultFaceUp, _
>                     myEnv.DefaultOrientation
>             ElseIf .Tab = 1 Then 'mailing label
>           Set myLabel = Application.MailingLabel
>                 myLabel.PrintOut _
>                     myLabel.DefaultLabelName, _
>                     .AddrText, .ExtractAddress, _
>                     myLabel.DefaultLaserTray, _
>                     .SingleLabel, .LabelRow, .LabelColumn
>             End If
>         End If
>     End With
>     Set myDlg = Nothing

> End Sub



Tue, 30 Aug 2005 07:01:15 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Paging through long text stored in single row and column

2. Paging through long text stored in single row and column

3. Position Combo on MSFlexgird specific row/column

4. Creating Mailing Labels - How to print single lable multiple times on same page

5. Single-row refresh operation returned multiple row

6. Printing Rows and Columns in a Datagrid

7. List View Column - - Possible items in a Single Column

8. Exporting multi-column details to word, rtf or xls comes out single-column

9. Error creating rows with columns having different column width

10. FlexGrid Merge Columns: Row/Column selection inconsistant?!?!

11. HELP! How do I print out to specific row/columns on a piece of paper.

12. Label Printing: Best 3rd Party control for labels?

 

 
Powered by phpBB® Forum Software