Results 1 to 2 of 2

Thread: Stop asking template to save

  1. #1

    Thread Starter
    Fanatic Member Bombdrop's Avatar
    Join Date
    Apr 2001
    Location
    St Helens, England, UK
    Posts
    667

    Unhappy Stop asking template to save

    Hi all I'm writitng a template that adds a combo box tothe standard controlbar. but when saving the document it also wants to save changes to the .dot file also.

    VB Code:
    1. Private Sub Document_New()
    2.    
    3.          
    4. Dim cboNames As CommandBarComboBox
    5. Dim objToolbar As CommandBar
    6.  
    7. Dim conTelList As ADODB.Connection
    8. Dim recNames As ADODB.Recordset
    9. Dim strQuery As String
    10.  
    11.     'establish the connection to DB
    12.     Set conTelList = New ADODB.Connection
    13.     conTelList.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Lvp-web\published\websites\Ganda intranet\_databases\phone_internal2000.mdb;Persist Security Info=False"
    14.  
    15.     strQuery = "Select Firstname,Surname,Location,ext,email"
    16.     strQuery = strQuery & " From Employees where Firstname <>" & """ & """
    17.  
    18.  
    19.     'Set an ope the recordset
    20.     Set recNames = New ADODB.Recordset
    21.     recNames.Open strQuery, conTelList
    22.  
    23.  
    24.     'Get hold of the Standard CommandBar
    25.     Set objToolbar = ActiveDocument.CommandBars("standard")
    26.  
    27.     'Insert the ComboBox into the Standard CaommandBar
    28.     Set cboNames = objToolbar.Controls.Add(Type:=msoControlComboBox, _
    29.         Temporary:=True)
    30.  
    31.  
    32.  
    33.     'Set Fill cboNames and set up properties
    34.     With cboNames
    35.         'Loop throught the Recordset and populate the ComboBox
    36.         Do While Not recNames.EOF
    37.             .AddItem recNames!firstname & Space$(1) & recNames!Surname
    38.             recNames.MoveNext
    39.         Loop 'While Not recNames.EOF
    40.  
    41.         .TooltipText = "Names"
    42.         .Text = "Select Name"
    43.         .OnAction = "Selection"
    44.         .Width = 155
    45.         .DropDownWidth = 155
    46.  
    47.     End With 'cboNames
    48. '
    49.  
    50. End Sub

    Why is the dot file being modified any help please would be great!!!!!

  2. #2

    Thread Starter
    Fanatic Member Bombdrop's Avatar
    Join Date
    Apr 2001
    Location
    St Helens, England, UK
    Posts
    667
    Herse an example of what i am doing
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width