Please can anyone tell me why the below does not work.

Many thanks

Private Sub CBOXCURRENTPLAIN_Click()

If CBOXCURRENTPLAIN.Value = True Then


With Dialogs(wdDialogFilePrintSetup)
.Printer = "\\rother\CanonMF13"
.DoNotSetAsSysDefault = True
.Execute

ActiveDocument.PrintOut Range:=wdPrintCurrentPage
End With

End If
End Sub

Re: Printing Current Page problem by Doug

Doug
Thu Jun 01 11:04:54 CDT 2006

Move the End With to before the ActiveDocument.PrintOut and it should work.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Addy" <Addy@discussions.microsoft.com> wrote in message
news:D41E1FB3-850A-442F-8449-64646C98A910@microsoft.com...
> Please can anyone tell me why the below does not work.
>
> Many thanks
>
> Private Sub CBOXCURRENTPLAIN_Click()
>
> If CBOXCURRENTPLAIN.Value = True Then
>
>
> With Dialogs(wdDialogFilePrintSetup)
> .Printer = "\\rother\CanonMF13"
> .DoNotSetAsSysDefault = True
> .Execute
>
> ActiveDocument.PrintOut Range:=wdPrintCurrentPage
> End With
>
> End If
> End Sub



Re: Printing Current Page problem by Addy

Addy
Thu Jun 01 11:26:01 CDT 2006

Many thanks but I've already tried that and it still doesn't work - any more
ideas?

cheers

"Doug Robbins - Word MVP" wrote:

> Move the End With to before the ActiveDocument.PrintOut and it should work.
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "Addy" <Addy@discussions.microsoft.com> wrote in message
> news:D41E1FB3-850A-442F-8449-64646C98A910@microsoft.com...
> > Please can anyone tell me why the below does not work.
> >
> > Many thanks
> >
> > Private Sub CBOXCURRENTPLAIN_Click()
> >
> > If CBOXCURRENTPLAIN.Value = True Then
> >
> >
> > With Dialogs(wdDialogFilePrintSetup)
> > .Printer = "\\rother\CanonMF13"
> > .DoNotSetAsSysDefault = True
> > .Execute
> >
> > ActiveDocument.PrintOut Range:=wdPrintCurrentPage
> > End With
> >
> > End If
> > End Sub
>
>
>

Re: Printing Current Page problem by Doug

Doug
Thu Jun 01 12:34:45 CDT 2006

Try without the With - End With part.

Does the document then print to the default printer? If so, there's a
problem with your reference to the printer.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Addy" <Addy@discussions.microsoft.com> wrote in message
news:15C93E81-22B2-4FA7-98D1-AEBAC6288994@microsoft.com...
> Many thanks but I've already tried that and it still doesn't work - any
> more
> ideas?
>
> cheers
>
> "Doug Robbins - Word MVP" wrote:
>
>> Move the End With to before the ActiveDocument.PrintOut and it should
>> work.
>>
>> --
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "Addy" <Addy@discussions.microsoft.com> wrote in message
>> news:D41E1FB3-850A-442F-8449-64646C98A910@microsoft.com...
>> > Please can anyone tell me why the below does not work.
>> >
>> > Many thanks
>> >
>> > Private Sub CBOXCURRENTPLAIN_Click()
>> >
>> > If CBOXCURRENTPLAIN.Value = True Then
>> >
>> >
>> > With Dialogs(wdDialogFilePrintSetup)
>> > .Printer = "\\rother\CanonMF13"
>> > .DoNotSetAsSysDefault = True
>> > .Execute
>> >
>> > ActiveDocument.PrintOut Range:=wdPrintCurrentPage
>> > End With
>> >
>> > End If
>> > End Sub
>>
>>
>>



Re: Printing Current Page problem by Addy

Addy
Fri Jun 02 04:19:02 CDT 2006

It won't work taking the with end with out. Its supposed to print to our
photocopier but I want it then to revert back to the default laser printer.
The printer code works on all my other macros fine. I found that bit of code
yesterday before that I tried

ActivePrinter = "\\rother\lex1340"
Else
ActivePrinter = "\\rother\lex1435"

as we have 2 printers in our dept but that only defaulted to the lex1340 and
wouldn't default to the 1435 for the people that use that printer. The new
code also seems to have quicked up the macros.

Would you believe it its working now. Just tried it again but with just
plain text and its working. I think it could have been the document I was
using as it had loads of field codes, cross ref and comments in it.

Thanks for your help anyway

Addy

"Doug Robbins - Word MVP" wrote:

> Try without the With - End With part.
>
> Does the document then print to the default printer? If so, there's a
> problem with your reference to the printer.
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "Addy" <Addy@discussions.microsoft.com> wrote in message
> news:15C93E81-22B2-4FA7-98D1-AEBAC6288994@microsoft.com...
> > Many thanks but I've already tried that and it still doesn't work - any
> > more
> > ideas?
> >
> > cheers
> >
> > "Doug Robbins - Word MVP" wrote:
> >
> >> Move the End With to before the ActiveDocument.PrintOut and it should
> >> work.
> >>
> >> --
> >> Hope this helps.
> >>
> >> Please reply to the newsgroup unless you wish to avail yourself of my
> >> services on a paid consulting basis.
> >>
> >> Doug Robbins - Word MVP
> >>
> >> "Addy" <Addy@discussions.microsoft.com> wrote in message
> >> news:D41E1FB3-850A-442F-8449-64646C98A910@microsoft.com...
> >> > Please can anyone tell me why the below does not work.
> >> >
> >> > Many thanks
> >> >
> >> > Private Sub CBOXCURRENTPLAIN_Click()
> >> >
> >> > If CBOXCURRENTPLAIN.Value = True Then
> >> >
> >> >
> >> > With Dialogs(wdDialogFilePrintSetup)
> >> > .Printer = "\\rother\CanonMF13"
> >> > .DoNotSetAsSysDefault = True
> >> > .Execute
> >> >
> >> > ActiveDocument.PrintOut Range:=wdPrintCurrentPage
> >> > End With
> >> >
> >> > End If
> >> > End Sub
> >>
> >>
> >>
>
>
>

Re: Printing Current Page problem by Graham

Graham
Fri Jun 02 09:41:21 CDT 2006

See also the code example at http://www.gmayor.com/fax_from_word.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Addy wrote:
> It won't work taking the with end with out. Its supposed to print to
> our photocopier but I want it then to revert back to the default
> laser printer. The printer code works on all my other macros fine. I
> found that bit of code yesterday before that I tried
>
> ActivePrinter = "\\rother\lex1340"
> Else
> ActivePrinter = "\\rother\lex1435"
>
> as we have 2 printers in our dept but that only defaulted to the
> lex1340 and wouldn't default to the 1435 for the people that use that
> printer. The new code also seems to have quicked up the macros.
>
> Would you believe it its working now. Just tried it again but with
> just plain text and its working. I think it could have been the
> document I was using as it had loads of field codes, cross ref and
> comments in it.
>
> Thanks for your help anyway
>
> Addy
>
> "Doug Robbins - Word MVP" wrote:
>
>> Try without the With - End With part.
>>
>> Does the document then print to the default printer? If so, there's
>> a problem with your reference to the printer.
>>
>> --
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "Addy" <Addy@discussions.microsoft.com> wrote in message
>> news:15C93E81-22B2-4FA7-98D1-AEBAC6288994@microsoft.com...
>>> Many thanks but I've already tried that and it still doesn't work -
>>> any more
>>> ideas?
>>>
>>> cheers
>>>
>>> "Doug Robbins - Word MVP" wrote:
>>>
>>>> Move the End With to before the ActiveDocument.PrintOut and it
>>>> should work.
>>>>
>>>> --
>>>> Hope this helps.
>>>>
>>>> Please reply to the newsgroup unless you wish to avail yourself of
>>>> my services on a paid consulting basis.
>>>>
>>>> Doug Robbins - Word MVP
>>>>
>>>> "Addy" <Addy@discussions.microsoft.com> wrote in message
>>>> news:D41E1FB3-850A-442F-8449-64646C98A910@microsoft.com...
>>>>> Please can anyone tell me why the below does not work.
>>>>>
>>>>> Many thanks
>>>>>
>>>>> Private Sub CBOXCURRENTPLAIN_Click()
>>>>>
>>>>> If CBOXCURRENTPLAIN.Value = True Then
>>>>>
>>>>>
>>>>> With Dialogs(wdDialogFilePrintSetup)
>>>>> .Printer = "\\rother\CanonMF13"
>>>>> .DoNotSetAsSysDefault = True
>>>>> .Execute
>>>>>
>>>>> ActiveDocument.PrintOut Range:=wdPrintCurrentPage
>>>>> End With
>>>>>
>>>>> End If
>>>>> End Sub