Calling MS Word Toolbar from Access VBA (1 Viewer)

bsiemsen

Registered User.
Local time
Today, 00:11
Joined
Jul 23, 2014
Messages
14
Hey hey hey,

Is it possible to directly open the MS Word toolbar from Access?? I would like to write the VBA code so when my user presses the control button it opens Word on the Tool/Envelopes and Labels toolbar pop-up - They need to print a single label.

The generic code would read something like this (no giggling please)

Dim oApp As Object
Set oApp = CreateObject(Class:="Word.Application - syntax to correct toolbar")
oApp.Visible = True

Any help is appreciated.
Thanx
Bill
 

JHB

Have been here a while
Local time
Today, 09:11
Joined
Jun 17, 2012
Messages
7,732
Try the below:
Code:
oApp.Documents.Add
oApp.Dialogs(WdWordDialog.wdDialogToolsCreateLabels).Show
 

bsiemsen

Registered User.
Local time
Today, 00:11
Joined
Jul 23, 2014
Messages
14
Thanx for the quick reply. I cut the code exactly as below. Word opens but I get an "Object Required" error msg when the last line executes.

Dim oApp As Object
Set oApp = CreateObject(Class:="Word.Application")
oApp.Visible = True
oApp.Documents.Add
oApp.dialogs(WdWordDialog.wdDialogToolsCreateLabels).Show

If it makes any difference, I’m using Access 2000 ADO and calling Word 2000. Did I do something wrong or forget something?

Thanks
Bill
 

bsiemsen

Registered User.
Local time
Today, 00:11
Joined
Jul 23, 2014
Messages
14
Hey hey hey,

Nope, I didn't have it set. I did set it as you suggested and it WORKS!

Thank you for your help.
(Now could you help me train my users???)
Bill :)
 

bsiemsen

Registered User.
Local time
Today, 00:11
Joined
Jul 23, 2014
Messages
14
Me again. Continuation of same problem. I need to change the default label number. By default it is 2160 and I need to change it to 8160 (for now). The users don't know the form number that is loaded, they just push the button.

Is there any reference articles on the syntax of how this all works. I hate to keep bugging you.
Bill :-(
 

JHB

Have been here a while
Local time
Today, 09:11
Joined
Jun 17, 2012
Messages
7,732
I think there are on the Internet try Google:
WdWordDialog+wdDialogToolsCreateLabels
Else ask in a Word forum, I think you'll get better help there! :)
 

bsiemsen

Registered User.
Local time
Today, 00:11
Joined
Jul 23, 2014
Messages
14
Hey hey hey,

Will do and thanks again for the help.
Bill
 

JHB

Have been here a while
Local time
Today, 09:11
Joined
Jun 17, 2012
Messages
7,732
You're welcome, luck with your project. :)
 

Users who are viewing this thread

Top Bottom