Computing.Net > Forums > Office Software > Creating a word/excell macro

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Creating a word/excell macro

Reply to Message Icon

Name: lordstorm
Date: July 28, 2005 at 08:43:47 Pacific
OS: winXP
CPU/Ram: 3.2 ghz/512 ddr
Comment:

greetings all,

i would like to build a macro in Word and Excel which prompts the user, before printing, with a yes or no question:

(for example) "would u like this sentence printed at the bottom?".

If yes, the text (again this is an example):

"this text should be at the bottom of your page!"

should appear at the bottom of the document and it will print this document including the text.

If no, then it will continue to print without it of course.

is there any way of doing this? any help would be greatly appreciated



Sponsored Link
Ads by Google

Response Number 1
Name: rhawk7938
Date: July 28, 2005 at 10:46:05 Pacific
Reply:

It can be done with VBA usng the before print declaration in the workbook.

Example:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Msg = "ARE YOU READY TO PRINT??"
ans = MsgBox(Msg, vbYesNo, "")
If ans = vbNo Then Cancel = True
End Sub


0

Response Number 2
Name: lordstorm
Date: July 28, 2005 at 13:24:17 Pacific
Reply:

thanks much! that's a good start for me.
i'm not much of a VB scripter but this is a good start


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Please help me with Excel... can a *.pst file contains...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Creating a word/excell macro

Word 2003 Macro www.computing.net/answers/office/word-2003-macro/4106.html

Determining a word file's integrity www.computing.net/answers/office/determining-a-word-files-integrity/6912.html

Creating a simple excel function www.computing.net/answers/office/creating-a-simple-excel-function/599.html