CommandBar in Word 97 
Author Message
 CommandBar in Word 97

Hello, I have created a .dot template whit references to the following
Object Libraries:

- Visual Basic For Applications
- MS Word Object Library 8.0
- OLE Automation
- Microsoft Forms 2.0 OLB
- Microsoft Office 8.0 OLB

The user of the template gets a error  RTE 5981 Object or Library not found,
whit the code breaking on a routine that adds a CommandBar to the Word
Application.

I suspect that the Microsoft Office 8.0 OLB is not present. How do i deploy
the necessary OLB's to the user?
Or is there an other error that i don't see`???

Regards, Bent

Sub AddToolBar()
CustomizationContext = ActiveDocument            <- debug starts on this
line......

    Dim cbrWiz As CommandBar
   Dim ctlInsert    As CommandBarButton
   On Error Resume Next
   ' Determine whether command bar already exists.
   Set cbrWiz = CommandBars(CBR_INSERT)
   ' If command bar does not exist, create it.
   If cbrWiz Is Nothing Then
      Err.Clear
      Set cbrWiz = CommandBars.Add(CBR_INSERT)
      ' Make command bar visible.
      cbrWiz.Visible = True
      ' Add button control.
      Set ctlInsert = cbrWiz.Controls.Add
      With ctlInsert
         .Style = msoButtonCaption
         .Caption = CTL_INSERT
         .Tag = CTL_INSERT
         ' Specify procedure that will run when button is clicked.
         .OnAction = "ShowDocInfo"
      End With
'...Else
      ' Make sure the existing commandbar is visible
      cbrWiz.Visible = True
   End If

End Sub



Sun, 06 Jun 2004 05:12:47 GMT  
 CommandBar in Word 97
Hi Bent,

The references are setup in your template, and will perform and run ok
provided the user machines have the same system setup as the
'development'  machine.

Quote:
> - Visual Basic For Applications
> - MS Word Object Library 8.0
> - OLE Automation
> - Microsoft Forms 2.0 OLB
> - Microsoft Office 8.0 OLB

Stop the de{*filter*} when you're trying to run your application on a user
machine.
In VBE (note: still testing this on a user pc), check in
Tools|Options|References to see whether references are indicated missing.

From the outset, try to develop according to the target system/desktop your
application should run on; simulate the user's desktop on the development
machine.
It's no use, creating wonderfull applications when the target system (from
it's setup)
will obstruct your application to run properly.

Kind regards,
Perry



Quote:
> Hello, I have created a .dot template whit references to the following
> Object Libraries:

> - Visual Basic For Applications
> - MS Word Object Library 8.0
> - OLE Automation
> - Microsoft Forms 2.0 OLB
> - Microsoft Office 8.0 OLB

> The user of the template gets a error  RTE 5981 Object or Library not
found,
> whit the code breaking on a routine that adds a CommandBar to the Word
> Application.

> I suspect that the Microsoft Office 8.0 OLB is not present. How do i
deploy
> the necessary OLB's to the user?
> Or is there an other error that i don't see`???

> Regards, Bent

> Sub AddToolBar()
> CustomizationContext = ActiveDocument            <- debug starts on this
> line......

>     Dim cbrWiz As CommandBar
>    Dim ctlInsert    As CommandBarButton
>    On Error Resume Next
>    ' Determine whether command bar already exists.
>    Set cbrWiz = CommandBars(CBR_INSERT)
>    ' If command bar does not exist, create it.
>    If cbrWiz Is Nothing Then
>       Err.Clear
>       Set cbrWiz = CommandBars.Add(CBR_INSERT)
>       ' Make command bar visible.
>       cbrWiz.Visible = True
>       ' Add button control.
>       Set ctlInsert = cbrWiz.Controls.Add
>       With ctlInsert
>          .Style = msoButtonCaption
>          .Caption = CTL_INSERT
>          .Tag = CTL_INSERT
>          ' Specify procedure that will run when button is clicked.
>          .OnAction = "ShowDocInfo"
>       End With
> '...Else
>       ' Make sure the existing commandbar is visible
>       cbrWiz.Visible = True
>    End If

> End Sub



Wed, 09 Jun 2004 19:33:14 GMT  
 CommandBar in Word 97
Hi Bent,

The references are setup in your template, and will perform and run ok
provided the user machines have the same system setup as the
'development'  machine.

Quote:
> - Visual Basic For Applications
> - MS Word Object Library 8.0
> - OLE Automation
> - Microsoft Forms 2.0 OLB
> - Microsoft Office 8.0 OLB

Stop the de{*filter*} when you're trying to run your application on a user
machine.
In VBE (note: still testing this on a user pc), check in
Tools|Options|References to see whether references are indicated missing.

From the outset, try to develop according to the target system/desktop your
application should run on; simulate the user's desktop on the development
machine.
It's no use, creating wonderfull applications when the target system (from
it's setup)
will obstruct your application to run properly.

Kind regards,
Perry



Quote:
> Hello, I have created a .dot template whit references to the following
> Object Libraries:

> - Visual Basic For Applications
> - MS Word Object Library 8.0
> - OLE Automation
> - Microsoft Forms 2.0 OLB
> - Microsoft Office 8.0 OLB

> The user of the template gets a error  RTE 5981 Object or Library not
found,
> whit the code breaking on a routine that adds a CommandBar to the Word
> Application.

> I suspect that the Microsoft Office 8.0 OLB is not present. How do i
deploy
> the necessary OLB's to the user?
> Or is there an other error that i don't see`???

> Regards, Bent

> Sub AddToolBar()
> CustomizationContext = ActiveDocument            <- debug starts on this
> line......

>     Dim cbrWiz As CommandBar
>    Dim ctlInsert    As CommandBarButton
>    On Error Resume Next
>    ' Determine whether command bar already exists.
>    Set cbrWiz = CommandBars(CBR_INSERT)
>    ' If command bar does not exist, create it.
>    If cbrWiz Is Nothing Then
>       Err.Clear
>       Set cbrWiz = CommandBars.Add(CBR_INSERT)
>       ' Make command bar visible.
>       cbrWiz.Visible = True
>       ' Add button control.
>       Set ctlInsert = cbrWiz.Controls.Add
>       With ctlInsert
>          .Style = msoButtonCaption
>          .Caption = CTL_INSERT
>          .Tag = CTL_INSERT
>          ' Specify procedure that will run when button is clicked.
>          .OnAction = "ShowDocInfo"
>       End With
> '...Else
>       ' Make sure the existing commandbar is visible
>       cbrWiz.Visible = True
>    End If

> End Sub



Wed, 09 Jun 2004 19:33:14 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Word 2002: How to save a file in Word 97 format in Word 2002

2. ANNOUNCE: Office 97 CommandBars

3. FREEWARE: Office 97 CommandBars

4. Commandbar : Office 97 shared object

5. Commandbar : Office 97 shared object

6. Help Needed - Passing Value from Access 97 to Word 97 Macro

7. Access 97 create a Word 97 letter

8. MailMerge from Access 97 to Word 97, value lost

9. Word (97) constants in Access (97)

10. Automation seems to hang with Access 97 / Word 97

11. Saving a Word 97 Document in a Access 97 table

12. Can you pass a table to Word 97 from Access 97

 

 
Powered by phpBB® Forum Software