page-setup

Interop - prevent a table wrapping over two pages in Word

一个人想着一个人 提交于 2020-01-14 05:06:05
问题 I am outputting multiple tables with a minimum of two lines of header information followed by 0 or several lines of data... My problem is that sometimes the tables wrap over the end of the page. How can I prevent this - is there a s property like doNotWrap' in MS Word tables? Here is the code I am using: // it's an Account list so what follows will be account data then transactions string[] sValues = pqRequests[s].Split('\t'); if (sValues[0]=="01") { iTable++; // output header info if

can't set PageSetup.Orientation = xlLandscape from MS Project

拟墨画扇 提交于 2019-12-12 23:03:27
问题 Using VBA in MS Project 2003 I create an Excel sheet and write data to it. After that I want to change SetPrintArea and Orientation of the sheet I created so I wrote with xlsheet '// Defined being an Excel.Worksheet For i = 1 To .UsedRange.Columns.Count .Columns(i).EntireColumn.AutoFit Next i txtPrintArea = txtPrintArea & "$" & xlCol.Row '// I created the range to print before With .PageSetup .Orientation = xlLandscape .PrintArea = xlSheet.UsedRange.Address End With End With It crashes at the

VBA statements for pagesetup only executed in debug mode

守給你的承諾、 提交于 2019-12-11 05:07:19
问题 The following sub is supposed to prepare pagesetup for a PDF output. For instance, if due to other attached printers the pagebrakes are messed up, the sub should fix it back to 1 page wide and 3 pages tall. Sub adjustPB(ws As Variant, ps As XlPaperSize) 'On Error Resume Next Application.DisplayAlerts = False Application.PrintCommunication = False With ws.PageSetup .LeftMargin = Application.InchesToPoints(0) .RightMargin = Application.InchesToPoints(0) .TopMargin = Application.InchesToPoints(0

Use VBA to copy an image from headers/footers of one sheet to another

家住魔仙堡 提交于 2019-12-02 04:56:18
问题 I need to write a VBA code to copy a company logo in the headers/footers of one excel sheet to another sheet in another workbook. Any ideas? 回答1: Excel has a handy Record Macro function. You can initiate that, Copy the footer over, then stop the recording. Then, review the code, and it should pretty much show you how to do it. 回答2: If you are working in anything older than Excel 2007 then it doesn't sound like this is possible without using the original graphic file (e.g. JPG, GIF etc):

Use VBA to copy an image from headers/footers of one sheet to another

六月ゝ 毕业季﹏ 提交于 2019-12-02 01:38:40
I need to write a VBA code to copy a company logo in the headers/footers of one excel sheet to another sheet in another workbook. Any ideas? Excel has a handy Record Macro function. You can initiate that, Copy the footer over, then stop the recording. Then, review the code, and it should pretty much show you how to do it. If you are working in anything older than Excel 2007 then it doesn't sound like this is possible without using the original graphic file (e.g. JPG, GIF etc): Normally, you can copy and paste the headers and footers from one worksheet to another by selecting the worksheets and