![]() |
|
#1
|
||||
|
||||
![]()
You have a lot of ancient WordBasic code there, which suggests it was written before Word 97 was released, some two decades ago! The whole lot should be re-written in VBA.
As for what your code is doing, it appears to be clearing content from the page headers. If you're clearing the entire content, that can be done with a lot less fuss than your current approach and, as for the undo processing, if you save the document before printing you could simply reload the saved copy afterwards without all the Undo issues. Accordingly, it would be helpful if you could clarify what you're going. PS: When posting code, please use the code tags, indicated by the # button on the posting menu. Without them, your code loses much of whatever structure it had.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Paul,
As noted earlier, I've inherited this app. and have never worked with WordBasic or VBA. From what I understand from the user is, when printing the document, two picture BMP's and text are to be removed from the header and footer. The application actually uses 3 .DOTM files, it opens up a Main.DOTM (this one has the FilePrint(...) ), then a Save.DOTM and then the data.DOTM template which has all of the bookmarks, cells, etc. When you print the data.DOTM template, this should remove the items noted above. I don't understand why you need the 3 of them, maybe back in the day that is how it was to be done, but as you say, it looks like it needs to be re-written in todays standards or done another way. I've done some research on the Inet about word basic but there doesn't seem to be much, so trying to figure out some of the code is a little difficult. Will use the code tags in the future. Thanks, William |
#3
|
||||
|
||||
![]()
OK, but is there any other header content that is to be retained for print purposes?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
![]()
In regards to the header, there is no other information that needs to retained for printing. You may ask, why not just remove it, it is needed for viewing purposes.
As for the footer, there is additional text that does need to retained for printing purposes. I've found some info. on Application.DocumentBeforePrint Event but I'm trying to figure out how to incorporate the event, where as the current .DOTM files use Modules and this is using Class Modules. Thanks |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro code that prompts user to enter text, then does find/replace. | sfvegas | PowerPoint | 0 | 01-10-2016 08:02 PM |
Macro/VBA code to select ALL text in a textbox in microsoft excel and add a new row | jyfuller | Excel Programming | 11 | 06-01-2015 08:49 PM |
![]() |
AustinBrister | Word VBA | 8 | 05-28-2015 02:42 PM |
![]() |
ndnd | Word VBA | 10 | 01-06-2015 01:47 PM |
![]() |
simpleonline1234 | Word VBA | 1 | 02-25-2011 02:28 AM |