Help please with option buttons

V

vandaley

Hi,

I need to create option buttons in a user form in VBA word.

When the user clicks the option button it will add a piece of text with
screen shots to the document and then when following the wizard (user
form) more text and screen shots will be added when clicking certain
option buttons.

I've tried inserting autotext to bookmarks but the screen shots are not
added (i get an error in the document).

Any ideas?

Thanks,
 
J

Jay Freedman

I might be able to help if I had any idea what you're already trying
and what error it's causing. To try to get the right information, here
are some questions that occur to me:

1. What version of Word are you using? And what version(s) do you
expect others to use when they work with your userform?

2. When you say "userform", do you really mean what Word calls a
userform, a custom dialog designed in the VBA editor? (Lots of people
mistakenly refer to a protected form, using controls from the Forms
toolbar in the body of a document, as a "userform".)

3. What code do you have now?

4. Where do the inserted screen shots come from? Are they saved in
graphic-format files on disk (.jpg, .gif, .bmp?) or are they only on
the clipboard at the time the macro executes?

5. Are you inserting the screen shots into bookmarks? Or are you
trying to insert them into form fields which have "bookmarks" as
names?

6. What is the *exact* text of the error that occurs?

7. If necessary, would you be willing to send me a copy of your
template?

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
D

Dave Lett

Answered in microsoft.public.word.vba.general, I think. Please don't cross
post. If you have autotext that isn't inserting images, then I'm thinking
that you have set the RichText argument to True.

Dave
 
G

Greg Maxey

Dave,
.....then I'm thinking that you have set the RichText argument to True.

That could be my fault as I suggested in the userform group:

Private Sub OptionButton1_Click()
ActiveDocument.AttachedTemplate.AutoTextEntries("Test").Insert _
Where:=ActiveDocument.Bookmarks("Test").Range, RichText:=True
End Sub

I didn't test with an actual screen shot image (just text as the
AutoText).
 

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