options buttons

J

JEG

How do I set up options buttons so that it knows when someone selects
something and it disables the other buttons? Do I have to group them?
How do I do this?
Thanks!
 
J

Jay Freedman

JEG said:
How do I set up options buttons so that it knows when someone selects
something and it disables the other buttons? Do I have to group them?
How do I do this?
Thanks!

Go into the Properties for each option button and fill in the GroupName
property. All buttons that share the same value of GroupName will behave as
a single group. By using different values, you can have multiple independent
groups.
 
J

JEG

Thank you Jay.
I have another question. I am trying to have users be able to print out a
file based on the options button they click. How can I have a file
printout without opening the file? Is there a simple print command where
I can just say like "print file c:\abc.doc" or something? I would rather
the files not be opened to print them. I can only seem to do the macro if
the files are opened and then printed.

Thanks!
Jackie
 
J

Jay Freedman

JEG said:
Thank you Jay.
I have another question. I am trying to have users be able to print
out a file based on the options button they click. How can I have a
file printout without opening the file? Is there a simple print
command where I can just say like "print file c:\abc.doc" or
something? I would rather the files not be opened to print them. I
can only seem to do the macro if the files are opened and then
printed.

Thanks!
Jackie

Hi Jackie,

You can't print a document without opening it at all, but that doesn't mean
it has to appear on screen. The expression Visible:=False in the Open
command below will prevent the document from showing while it prints, and it
will close immediately afterward.

The expression Background:=False tells VBA to wait until Word has sent the
whole document to the spooler before going on to the Close command, rather
than doing "background printing" and immediately continuing (that would
cause Word to pop up the message "Word is still printing, do you want to
close anyway?").

Dim oDoc As Document
Set oDoc = Documents.Open(FileName:="lorem2.doc", Visible:=False)
With oDoc
.PrintOut Background:=False
.Close SaveChanges:=wdDoNotSaveChanges
End With
 
J

JEG

Thank again Jay. Does it work the same way in PowerPoint? Like if the
user is going to click a Print button while viewing the PPT screenshow? I
want to make sure that the screenshow doesn't stop when the file to be
printed is opened.

Jackie
 
J

JEG

Thank again Jay. Does it work the same way in PowerPoint? Like if the
user is going to click a Print button while viewing the PPT screenshow? I
want to make sure that the screenshow doesn't stop when the file to be
printed is opened.

Jackie
 
J

Jay Freedman

Thank again Jay. Does it work the same way in PowerPoint? Like if the
user is going to click a Print button while viewing the PPT screenshow? I
want to make sure that the screenshow doesn't stop when the file to be
printed is opened.

Jackie

Sorry, I don't know much about PPT. You should ask on the PPT
newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top