Ricerca 
it-ITen-US
Register
Login
In-Vesti Dotnetwork
IN-VESTI DNW!!!
Sono finalmente arrivate le nuovissime T-Shirt di DotNetWork!!! Con soli 15,00 € ci sosterrai nelle spese di gestione della Community e ti invieremo a casa una splendida maglietta.
Se vuoi contribuire al mantenimento di DotNetWork.it Vai sulla pagina Iscrizioni
Effettua il pagamento usando IWBank
Click per andare alla pagina di Iscrizione
Oppure un Bonifico bancario (le coordinate sono sulla pagina Iscrizioni), inviaci una mail a support@dotnetwork.it indicandoci la tua taglia e l'indirizzo di spedizione.  Non appena verificata la ricezione del pagamento provvederemo a spedirti la tua T-Shirt.  Le magliette sono disponibili nelle taglie S-M-L-XL-XXL (in caso di esaurimento di una delle taglie, indica quella di "Backup"). Grazie per IN-VESTIRTI con NOI!!!
.:DotNetWork Founders:.
    Print     


DotNetWork Forums
TIP: Evitare da Word / VBA il messaggio "I margini della sezione ..."
Last Post 08 Nov 2007 17:50 by Max. 1 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages

Posts:436

--
08 Nov 2007 17:47  
Ciao a tutti.
Posto il mio messaggio qui e credo sia LA SOLUZIONE per tutti quelli che hanno il problema in oggetto.

Chiarisco:
Quando si stampa un documento WOrd che ha i margini impostati fuori dai margini fisici della stampante in uso (per fare una prova metterli tutti a 0) viene generato un messaggio che cita:

"I margini della sezione 1 sono esterni all'area di stampa, Continuare?"

Le opzioni sono:

Correggi: imposta automaticamente i margini minimi per la stampante in uso.
Ignora: Stampa cosi' com'e'. Esce quello che esce. :D

Nessun problema se davanti alla tastiera ci siete voi che in "modalita Omer" premete il bel tastino.

Ma se succede da un programma VB / VBA che succede? resta tutto fermo finche' non premete il tasto dell'opzione scelta.

A nulla vale impostare WordApplication.WDAlertLevel= WdAlertsNone. Il messaggio compare sempre.

Ecco la soluzione.
Impostare la stampa in Background a OFF.

Cito da una slide di un MVP (http://word.mvps.org/FAQs/MacrosVBA/OutsidePrintableArea.htm)

Suppressing message “The margins of section 1 are set outside the printable area of the page. Do you want to
continue ?” when printing from VBA

Article contributed by Ibby

You can use the Application.DisplayAlerts property to avoid this message. However, there is a trap. If background printing is turned on, DisplayAlerts will be turned off, then on before the page is sent to the printer. This results in the message still being displayed. If you tun off background printing, execution of the code will stop until the page is sent to the printer. Then you can turn DisplayAlerts back on.

With Application
' Turn off DisplayAlerts
.DisplayAlerts = wdAlertsNone

' Send document to printer but wait until it
' is sent before turning DisplayAlerts back on
.PrintOut Background:=False
.DisplayAlerts = wdAlertsAll
End With

provato e funziona....

HTH (e credo servira' a molti, o almeno spero...)

Max.

Posts:436

--
08 Nov 2007 17:50  
Aggiungo il mio pezzo di codice funzionanate:

Try
wapp = CreateObject("Word.Application")
wapp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone
wapp.WordBasic.FilePrintSetup(Printer:=prt, DoNotSetAsSysDefault:=1)
wapp.Documents.Open(MyDoc)
wapp.PrintOut(False, , , , , , , copie)
wapp.DisplayAlerts = Word.WdAlertLevel.wdAlertsAll
Catch ex As Exception

End Try

Max.
You are not authorized to post a reply.

Active Forums 4.1
       
Articoli
Mixed Fry - General purpouse classes (part 1)
Helper: A class to manage strings
2007/10/20 | Author: Sabrina Cosolo
Miniguida alla OOP con il .NET Framework- Parte III
Un' importante eredità: l'ereditarietà
2009/02/08 | Author: Alberto De Luca
Visual Studio LightSwitch Beta 1 - Installazione
La procedura di installazione e le risorse sul web
2010/08/24 | Author: Mario De Ghetto
Bitmap, GDI+,Collections,Classes
Classes and objects to use GDI+ to draw some shapes
2009/06/06 | Author: Sabrina Cosolo
Working with Arrays
The backpack problem
2007/07/29 | Author: Alberto De Luca
SQL Server Base Notions (part 1)
How to create a database in SQL Server using SQL Management Studio
2008/03/09 | Author: Sabrina Cosolo
Starting from Scratch with WPF (Part 3)
Rows, deities, brushes and refrigerators (first part)
2007/11/22 | Author: Sabrina Cosolo
ADO.NET Funzionalità di base
Effettuare una ricerca su recordset disconnessi tramite DataView
2007/12/02 | Author: Andrea Zingoni
    Print     
Home|Forums|Blogs|Mappa del sito
© 2007-2010 by DotNetWork  .:.  Terms Of Use  .:.  Privacy Statement  .:.  Login  .:.