Userform - Printing

Hi all I have a problem I am using the following code,

Private Sub cmdPrint_Click()
   frmOrders.PrintForm
End Sub

How is it possible to get the userform to be printed in landscape

Thanks in advance

Greg



0
browshop (35)
3/13/2005 10:49:16 AM
excel.misc 78881 articles. 5 followers. Follow

8 Replies
418 Views

Similar Articles

[PageSpeed] 36

Greg,

You could throw up a print dialog and allow the user to select landscape
(and even the printer if required), and then print after, something like

Private Sub cmdPrint_Click()
Dim fOK As Boolean
Dim sPrinter As String

    With Application
        sPrinter = .ActivePrinter
        fOK= .Dialogs(xlDialogPrinterSetup).Show
    End With

    If fOK= Then
        frmOrders.PrintForm
        Application.ActivePrinter = sPrinter
    End If
End Sub


-- 

HTH

RP
(remove nothere from the email address if mailing direct)


"Greg B" <browshop@ihug.com.au> wrote in message
news:d115rr$jkn$1@lust.ihug.co.nz...
> Hi all I have a problem I am using the following code,
>
> Private Sub cmdPrint_Click()
>    frmOrders.PrintForm
> End Sub
>
> How is it possible to get the userform to be printed in landscape
>
> Thanks in advance
>
> Greg
>
>
>


0
bob.phillips1 (6510)
3/13/2005 11:53:06 AM
Thanks for your help but it is not working right.

I have a userform called "totals"  It shows all the information in a nice 
layout.

The trouble is it continues to print in portrait even when the settings are 
set at landscape.

Is it possible to print a userform in landscape?  Is there a setting I am 
not using.

Thanks again
Greg 


0
browshop (35)
3/13/2005 12:33:38 PM
See one more response to your other thread.

Greg B wrote:
> 
> Hi all I have a problem I am using the following code,
> 
> Private Sub cmdPrint_Click()
>    frmOrders.PrintForm
> End Sub
> 
> How is it possible to get the userform to be printed in landscape
> 
> Thanks in advance
> 
> Greg

-- 

Dave Peterson
0
ec357201 (5290)
3/13/2005 12:43:05 PM
I have used the other response from Bob Phillips and it still prints 
portrait.

I posted this twice because my isp must have been down.

Sorry for the double post

Greg 


0
browshop (35)
3/13/2005 12:55:43 PM
Greg,

Here is a technique that does work (I tested it :-) which Tom Oguily posted
some time back

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
    ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)


Private Const VK_SNAPSHOT = 44
Private Const VK_LMENU = 164
Private Const KEYEVENTF_KEYUP = 2
Private Const KEYEVENTF_EXTENDEDKEY = 1



Private Sub cmdPrint_Click()
   ' keybd_event VK_SNAPSHOT, 0, 0, 0
    DoEvents
    keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
    keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
    keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + _
        KEYEVENTF_KEYUP, 0
    keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + _
        KEYEVENTF_KEYUP, 0
    DoEvents
    Workbooks.Add
    Application.Wait Now + TimeValue("00:00:01")
    ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False,
DisplayAsIcon:=False
    ActiveSheet.PageSetup.Orientation = xlLandscape
    ActiveSheet.Range("A1").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    ActiveWorkbook.Close Savechanges:=False
End Sub


-- 

HTH

RP
(remove nothere from the email address if mailing direct)


"Greg B" <browshop@ihug.com.au> wrote in message
news:d11bvg$n1b$1@lust.ihug.co.nz...
> Thanks for your help but it is not working right.
>
> I have a userform called "totals"  It shows all the information in a nice
> layout.
>
> The trouble is it continues to print in portrait even when the settings
are
> set at landscape.
>
> Is it possible to print a userform in landscape?  Is there a setting I am
> not using.
>
> Thanks again
> Greg
>
>


0
bob.phillips1 (6510)
3/13/2005 1:18:07 PM
Thanks again Bob

Greg 


0
browshop (35)
3/13/2005 1:36:11 PM
But I wasn't writing about Bob's response.  

(although his new response looks quite similar to the one I posted (Thanks to
Tom!).)

Greg B wrote:
> 
> I have used the other response from Bob Phillips and it still prints
> portrait.
> 
> I posted this twice because my isp must have been down.
> 
> Sorry for the double post
> 
> Greg

-- 

Dave Peterson
0
ec357201 (5290)
3/13/2005 2:14:48 PM
"Dave Peterson" <ec35720@netscapeXSPAM.com> wrote in message
news:42344AD8.4D3F645A@netscapeXSPAM.com...
> But I wasn't writing about Bob's response.
>
> (although his new response looks quite similar to the one I posted (Thanks
to
> Tom!).)

The same I would say (apart from where the API stuff is declared), and I did
credit Tom, although I spelt his surname incorrectly (apologies Tom)/


0
bob.phillips1 (6510)
3/13/2005 2:40:22 PM
Reply:

Similar Artilces:

print worksheet group in color
I'm selecting a group of worksheets to print together, and want to print all of the worksheets in color. I specify on the printer dialog to print in color, however, only the first page actually prints in color. Inpage setup - sheet - print, black and white is not selected. Any thoughts? May be a printer issue? ...

Printing Options for a report on Access 2000
Hello everyone, My question is: When printing a report on Access 2000, How can I make the Printing Options appear so I can select the amount of copies for that particular report. As of right now when you select to print it will print the report without selecting the printer or the amount of copies you will like to print. Thanks in advance. -- Jeff Change the print option to acViewPreview rather than acViewNormal ...

Print macro
Hi there. I'm not very profficient at using Excel so forgive me if thi is not clear. I hope someone can help me. I want to be able to send a page of a worksheet to a fax recipient o email recipient as a page view. Each time I try to do this it send the whole worksheet. I only want to send a particular page numbe (page 3 in this case) and send it as a page view, not an attachment. After the fax or email has been sent I want to return to the workshee so I can continue adding data. I can make buttons etc, and assign macros (when clicked etc) but thi one has me stumped. Thanks for yo...

Printing Records
Once I have completed details on my form 'Customer_Details' with subform 'Job_Details' (Job_Details is the many sided part), I would like to print off only that record (current visible record) from my report - 'Customer_Orders'. My thoughts were to have a button on the form to issue the instruction to print - (2 copies would be ideal - one for the customer and one for the department to instruct the job). Can anyone point me in the right direction on how to achieve this? Sandy You aren't very clear. you seem to be using the terms "report" and &q...

Invoice prints original quantity ordered not quantity on invoice
When we print an invoice, it shows the original quantity ordered and not the actual fulfilled quantity as shown on Sales Transaction Inquiry Zoom. The Extended Price on the printed invoice is calculated with the fulfilled quantity though. If we open the Order, Quantity Ordered = 1, Extended Price = $0.92 If we open the Invoice, Invoice Quantity = 55, Extended Price = $39.60 If we print the invoice, Qty = 1, Extended Price = #39.60 ????? Now, if we open Sales Quantity Status Inquiry Zoom for the invoice, it says: Current Quantities: Invoiced = 1 Billed = 1 Originally Ordere...

printing #2
My computer is set up with two accounts (Business and Personal) in our Microsoft Money program. At the beginning I could print checks on both accounts. Now on the business side, print will come up in the check number box and not under the to do list. When I try to print a check on it will not print since it does not show up in the to do list. Also, could you explain how to print the second and third check on the sheet. We have tried to turn them sideway, but the checks do not print correctly. As of now I run each check with the three per sheet on the form checked. Running each sep...

Selective Printing of Graphs
I have a sheet full of graphs that are fed from a large datasheet. I want to only print a graph if it is populated with data and to not print graphs that have no data. Is this possible or is there a work around via some type of Macro. ...

Printe Odd Pages
Hello All, Can anybody tell me how can i take take printout only of Odd pages or Even Pages or selected page like page number 1,5,11,20 ect. in Excel 2003. Regards, Prem Soni Hi, Right click the sheet tab on the page you want to print, view code and paste this in and run it. Change start =1 to start = 2 to print even pages. Sub printit() Start = 1 Total = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") For Page = Start To Total Step 2 ActiveSheet.PrintOut from:=Page, To:=Page Next End Sub Mike "Prem Soni" wrote: > Hello All, > ...

Outlook 2000 doesn't print from command line
Hi, I have Office 2000 installed. When i try to print a message file (.msg) from command line with command : outlook.exe /p test.msg it diesn't do anything. No error at all and am unable to print from command line from outlook program which was working fine sometimes back but suddenly it stopped working. However it does work if i open outlook program from GUI and do file- >print. What could be the problem? Why it doen't work from commandline /p switch? Please help Thanks B ...

Is there a way to print a card in Publisher that is borderless.
I have an HP Officejet 7410 which is cabable of printing borderless but when I try to change it to print my card in Publisher 2003 borderless it says there is a conflict between the selection already for two sided printing. Can someone tell me how I can print two sided and borderless. Your printer may not be able to do both. I would suggest printing one side then manually flip it over. -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Mike L" <Mike L@discussions.microsoft.com> wrote in message news:D4DBDBA1-64...

Missing data when printing
I'm not sure if this is an Excel or OS problem. I'm using Excel 2000 on Windows 98. On the third page of a four page sheet data is missing at the bottom of page 3 on the print out and in print preview. The same sheet previews and prints correctly using Excel 2000 on Windows XP. Hi Walt....... When you say the "same sheet" prints ok on XP.............it matters if the two files came from the same source, as one could have been saved with a different PrintArea set than the other..........I would suggest you go to the XP computer and save the file to a floppy and then go ope...

How can I print a frame corresponding to page margins?
How can I print a frame corresponding to page margins? ...

Drawings not printing on x-y charts
I am superimposing a few lines "drawn" on an x-y chart. No problem until I "print preview" and notice that they are no longer evident, or print the chart and the drawings are absent. Am I overlooking something obvious? Thanks in advance for any tips here. Brad ...

No printing in OE 6
I've lost the ability to print emails in OE6. If I want to print a message I have to forward it to my Hotmail account and print it from there. I'm using Win XP. When I try to print, I just get a blank page from my printer. Any ideas? Try these three steps. 1: Your print margins may be set too small. In IE: File | Page Setup. (Default setting is 0.75 all around). 2: Go to Start | Run and type, (or copy/paste): regsvr32 ole32.dll Press Enter. 3: Web Page or E-mail Message Does Not Print or Preview Correctly in Internet Explorer 5.5 and Outlook Express 5.5...

picture prints with lines
Hi, Can you help me? My inserted jpg has no lines on it but when I insert it into the Pub. file I'm working with and print, lines are printed. I've tried deleting and reinserting the pic. and the same thing keeps happening. Additonally, I previewed both my jpg and my Pub. file; no lines are there... Thank you :) What kind of lines are you talking about? -- JoAnn Paules MVP Microsoft [Publisher] "Bobbi" <Bobbi@discussions.microsoft.com> wrote in message news:8F95B5B2-7C11-46FD-8E6D-AF39404493E1@microsoft.com... > Hi, > Can you help me? My inserted jp...

command line options/switches to print excel file
I need command line options/switches to print the excel file on printer. Like C:\> excel.exe C:\abc.xls /print or C:\> excel.exe -print C:\abc.xls I'm able to print DOC, PPT file but I could not do it. Can anyone tell me any command. for Doc file it is C:\Program Files\Microsoft Office\Office\WINWORD.EXE" testdocfile.doc / q /n /mFilePrintDefault /mFileExit Can anyone tell me a similar command for excel too. Thanks in advance ...

Leopard won't let word in office 2004 print
I have office 2004 and after leopard installed all options (e.g. duplex printing) is disabled. What gives? intrepid.one07@gmail.com wrote: > I have office 2004 and after leopard installed all options (e.g. > duplex printing) is disabled. > > What gives? This sounds like your printer may need to be set up again with the correct PPD chosen. The PPD (sometimes mistakenly called a "driver") is a description file and it describes the available options for your model of printer. Visit the support site of your printer and download and install the "driver" soft...

Suppress Printing with Character in Excel File
Is there a way to suppress printing a line by using a character in a cell? For example, IF($B2="","Suppress Print", $B2) Is there a "Suppress Print" character? Thanks! No Gord Dibben MS Excel MVP On Thu, 11 Feb 2010 12:47:02 -0800, Shannoni <Shannoni@discussions.microsoft.com> wrote: >Is there a way to suppress printing a line by using a character in a cell? >For example, > >IF($B2="","Suppress Print", $B2) > >Is there a "Suppress Print" character? > >Thanks! I ...

Screen print list of all files stored and not each individual file
Excel 2003 - After I select file, open, look-in, how do I print only the list of all files stored without actually printing each individual file? I tried highlighting all files stored, right click print and nothing happened! ...

Printing Tabs
I would like to print a list of the tab names without printing the whole document. Can anyone help me? Kathy You will need a macro. ''list of sheet names in a workbook - placed on a new worksheet Sub ShowNames() Set wkbkToCount = ActiveWorkbook iRow = 1 With Sheets.Add For Each ws In wkbkToCount.Worksheets .Rows(iRow).Cells(1).Value = ws.Name iRow = iRow + 1 Next End With End Sub Gord Dibben Excel MVP On Mon, 5 Dec 2005 09:01:02 -0800, Kathy@ACL <Kathy@ACL@discussions.microsoft.com> wrote: >I would like to print a...

Automatically print documents from a link
In Outlook 2003: when I receive an email with a link to documents, is there a way I can automatically have the documents print from the link?::eek: -- Millie http://forums.slipstick.com Is this a HTML message? Double click to open the message in its won window and then choose File-> Print... On the Options tab you can set the option to print all linked documents as well. -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real...

How can I change name on print out
Hi, How can I change the name that apears at the top of the page when I print out an email form Outlook? This is the name at the very top of the page, not the from or to line. I am using Windows XP with Outlook 2003 Thanks in advance, Lenny Go into the e-mail account (tools>e-mail accounts>select account>change), and change "your name" at the top. It prints whatever is in there, but remember that that is also the name people will see when they receive mail from you. HTH Mark "lenny" <lenny109@takeout.hotmail.com> wrote in message news:Dc2dndw5G...

Print Area
Hello I hope someone will help me to solve my problem. I have the data from column A to G (from H.. everything is blank) and keep adding data below it. Is there any way I can run a macro to selec the print area by finding the last row? Eg: if I have data in 16 row and when I run the macro it should select the range A1-G16 and set th print area. Row 17 will have no data in it. Hope it is clear. Thanks in Advance Regds Tom -- Message posted from http://www.ExcelForum.com Hi Just set your print area to columns A:G - the whole column. This will print as much as you've got in the column wi...

how to print individual pages of booklet
I was printing a 16 page booklet, which I use (4) 8 1/2" x 11" sheets of paper, with 2 pages of the booklet per side of paper arranged by the program so that when all four pages print one side, I then turn over all four pages, and the second side of all four pages print. Next I fold the pages in half and the booklet is in order from pages 1-16. When the first sides of the four pages are finised printing, a box pops up to prompt me to turn the pages over, however, this time that did not happen, only the first side of the four pages printed. I went to printing options to try to...

DTPicker controls missing from userform
I have a userform with about 20 microsoft date and time pickers. For some reason, I opended the file this morning and all the DTPickers are missing from my userform. I can't even find the control in my toolbox to redraw them. Am I missing a reference, if so, does Excel just delete them from your userform? What reference in VBA do I have to select or check off to get my DTPickers to show again? Thanks in advance!! -- Cheers, Ryan Very bizarre. I've never experienced this or even heard of such a thing. I Googled for an answer; your post (here) was about the onl...