I will attempt it ASAP. I have my doubts about 2. but I will still try.Originally Posted by Frosty
I will attempt it ASAP. I have my doubts about 2. but I will still try.Originally Posted by Frosty
No good, doesn't work.
Haha. You're a troll. Well played, I guess.
Not trolling, I just can't use VBA code properly. I tried it, but it won't work.Originally Posted by Frosty
If you're not trolling for effect, then you should try reading the entire post and following the instructions. For example, what does the instruction #1 (which you quoted in its entirety before) say to do? Did you do that?
Or did you just post "uhh, doesn't work."
*WHAT* doesn't work? What have you tried? What has failed?
As far as the evidence of this thread and your replies tells us, you might as well have thrown food at your monitor and are reporting that this is an ineffective way to print specific pages in a document.
Is your computer plugged in? Do you have microsoft word installed? Did you start Word? Do you have a document open? Does it contain 6 pages? Did you display the File Print dialog? Did you read the options available in the file print dialog? Did you attempt to print out pages 5-6? Did that work? Did you record a macro doing that action? Did you post that macro?
Those questions are all currently unanswered... except for the last one: you did *not* post that macro, as previously requested.
You will get no help from me in this thread until you attempt that. I have already unsubscribed myself from the other thread where you have demonstrated an amazing lack of effort when attempting to engage people who are trying to help you... for free.
I would suggest paying someone to train you how to use Microsoft Word. Or visit the microsoft website and go through some of their learning modules. It is very robust, and covers a number of topics you clearly have zero knowledge of.
I will repeat: yours is not a problem with VBA. Yours is a problem of some combination of lack of understanding and lack of effort. Understanding can come. We can not provide you with motivation.
Your next post determines whether I unsubscribe (and thus, stop responding) to this thread.
Good luck!
[VBA]ActivePrinter = "Microsoft XPS Document Writer"Originally Posted by Frosty
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="5-6", PageType:= _
wdPrintAllPages, ManualDuplexPrint:=False, Collate:=True, Background:= _
True, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, _
PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
End Sub[/VBA]
This is the recorded macro.
Did it work?
Yes, this macro works.Originally Posted by Frosty
But I need an input box with range options..
Does that macro work to print pages 5-6 of a document that isn't a test document (i.e., documents you would want to use the finished macro on)?
It does, yes.Originally Posted by Frosty
What is amazing to me is that you already posted the code to do this.
When you type in the input box, you will need to actually type "25-30" without the quotes. You will need to include the dash character as well as the page number range. But you may want to remove the line of code which sets the ActivePrinter, as this macro would force you to use the Microsoft XPS Document Printer every time, rather than whatever printer you currently have selected.
But that is your decision. If your response to this post is "doesn't work" then I will not be able to help you, sorry.
[VBA]
Sub Demo()
Dim sPagesToPrint As String
sPagesToPrint = InputBox("Print what pages?" & vbCr & "ex: 5-6", "VBAX Macro", "5-6")
'sets the active printer
ActivePrinter = "Microsoft XPS Document Writer"
'printout using the sPagesToPrint variable, with the values form the InputBox
Application.PrintOut FileName:="", _
Range:=wdPrintRangeOfPages, _
Item:=wdPrintDocumentContent, _
Copies:=1, _
Pages:=sPagesToPrint, _
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, _
Collate:=True, _
Background:=True, _
PrintToFile:=False, _
PrintZoomColumn:=0, _
PrintZoomRow:=0, _
PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
'original recorded macro, cleaned up and commented out
'Application.PrintOut FileName:="", _
Range:=wdPrintRangeOfPages, _
Item:=wdPrintDocumentContent, _
Copies:=1, _
Pages:="5-6", _
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, _
Collate:=True, _
Background:=True, _
PrintToFile:=False, _
PrintZoomColumn:=0, _
PrintZoomRow:=0, _
PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
End Sub
[/VBA]
_______________________________________________
Please don't cross-post without providing links to your cross-posts. We answer questions for free. Please don't waste the time of the people helping you.
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
- Frosty
It works as usual..
But how was I supposed to get to this:
[VBA]sPagesToPrint = InputBox("Print what pages?" & vbCr & "ex: 5-6", "VBAX Macro", "5-6")[/VBA]
I don't even know what vbCr is..
You don't need VbCR, that's just for making it pretty (that is a line break character).
You just needed to look up InputBox in the VBA help file, which was suggested earlier in this thread, as well as examples of InputBox in your other thread.
In short, you just need to read the posts of the people trying to help you. If you re-read this thread and your other thread, you will see that my post putting it all together could easily have been accomplished by you with a modicum of effort at attempting to understand.
You recorded a macro which printed out page 5. In that short bit of vba, there was clearly something that said "5"
You recorded a macro which printed out pages 5 and 6. In that short bit of vba, there was clearly something that said "5-6"
There were posts talking about looking up InputBox in the help.
There are two basic kinds posters who request help on this forum and meet with some degree of success:
1. People who already know a lot, and just need to be pointed in the right direction.
2. People who know very little, but are willing to learn.
You have been neither of those types, at least in these two threads. I have no idea what you are like as a person, but you have made it very difficult to help you--for free--with your lack of effort, your posting of entire previous posts in quotes combined with some variation of a one line response of your own: "it didn't work" -- and nothing else.
In short, you seem like the kind of person who should be paying for people to do this work for you, because you seem entirely disinterested in learning how to do it yourself.
This is not a judgement of your character as a person, but rather a judgement of your effort as a poster on this forum.
It is a waste of everyone's time to pretend to want answers--for free--without any desire to learn how to accomplish these tasks for yourself.
For me, the reason I post answers to questions is to help people help themselves become better at solving their own problems. In this thread, I've failed at that task, and am simply providing the answer so that I don't feel any obligation to answer you in the future, now that I know the kind of poster from your only two threads on this forum. You have managed to generate 120+ posts, all of which boil down to something along the lines of: "it didn't work, I don't know anything, how could I possibly know anything because I don't know anything!"
You are welcome to change my mind in your next thread, but it will require effort on your part. To have success at getting your questions answered in forums like this, you must bring 90% of the effort in diagnosing and defining the problem. Knowledge is the easy part. Lack of knowledge is no excuse. That is simply experience, and will come with time.
Willingness to learn and try and get better can not be provided by anyone except you.
Good luck.
_______________________________________________
Please don't cross-post without providing links to your cross-posts. We answer questions for free. Please don't waste the time of the people helping you.
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
- Frosty
I will second all of that. Zack you have been given ALL of the tools and information needed to make this work. If things do not work for you then YOU - and only you - are responsible for that failure. Not VBA. Not anyone here who has (in my opinion) wasted their time on you.
You have repeatedly asked how to get something from an inputbox into the pages parameter in order to get pages 20-25 (or whatever range of pages) to print. You have repeatedly been pointed to how to do that.
The fact you still appear to not get it is an obvious indication of out and out laziness.
Your other posts re-enforce this.
You are abusing this forum. Smarten up or I will formally ask that you be removed from this forum.
QUOTE Frosty:
"This is not a judgement of your character as a person, but rather a judgement of your effort as a poster on this forum."
Jason (Frosty) is much kinder and understanding than I am. Frankly, I think it IS a judgement of your character as a person. With all the pointers and attention paid to you, I think to ignore help, to abuse the help over and over again IS a reflection of character. There have been many many people who have come here knowing zero about using VBA, but who have tried to learn. Who have made effort to learn, to think and improve themselves and their abilities. It is what makes it fun and worthwhile for those of us who try and help them. Because we know that at one time WE were the same. Knowing little but wanting to know more. We do it because we feel it is right and proper to pass on knowledge.
Knowledge can not be fed to someone. It can only be offered, a gift so to speak. Gifts can be ignored, and fair enough. But gifts that are refused at the same time the person offered the gift repeatedly demands MORE gifts - or worse, the SAME gift - well that is abuse.
I will say it again.
You are abusing this forum. Smarten up or I will formally ask that you be removed.
Last edited by fumei; 09-21-2012 at 03:50 PM.