code to reactivate toolbars?

G

gil

Hi All,
I've automated some email functions from within my MS Word documents. But my Word toolbar functions do not function after emailing unless I either close Outlook or shift from Word to Outlook back and forth once or twice, OR close Outlook. It works entirely fine if I do not have Outlook open when using this autmoated emailing. I am using the code: "WordBasic.EmailSend" with Word 2003, Windows XP

I seek to append code to reactivate my toolbars so as to be in synch with the active Word document on screen (The toolbars are visible but inactive).

TIA and Cheers. :)

Gil Carter
www.TenSecondMedicalRecord.com still free, electronic medical records programming.
 
A

alborg

Hi Gil!

Try this-

Dim mybar, mybar2
Set mybar = CommandBars("Custom 2")
Set mybar2 = CommandBars("switchboardmain")
mybar.Visible = True
mybar2.Visible = True

Cheers,
Al
 
G

gil

Hi Al,
The toolbar is visible and not dim, but it's just not active until I spring out of Word to another program and back again, ... even
without closing Word.
Cheers,
Gil
 
R

Russ

Hey Gil,
If at the top of your toolbar button code you put a message box, does it pop
up.
If it does, then your toolbar button is active, but the code for the button
is confused about which application to apply itself.
 
G

gil

Well, I think I've found a work around.
First, I could not decide where the "top of my toolbar button code" was, as all the custom toolbar menus would not drop down after
the automated email code ran. So it wasn't just an isolated button. Putting a msg box in the autoopen code that attached the
custom template didn't seem like an appropriate location either.

Upon further play, I appended the following to the automated email code.
ShowVisualBasicEditor = True
ShowVisualBasicEditor = False

And the toolbars are again active (enabled?). Is there a better way to do this?

Also, I note that the document title (top banner) is grayed out after an automated email, even after continuing typing in the
document.

TIA,
Gil
 
G

gil

I take it back, ... on repeat testing, the doucment name banner is not grayed out. And the added code does meet my needs, altho a
little less than ideal coding.
Cheers and Thanks :)
 

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