Displaying a Custom Toolbar

G

Gilley

I have a template which in turns opens a new document with the contents of a
text file.

I have a custom toolbar which contains buttons to specific macros that
format the text files in a number of different ways. Invoice, Purchase
Order, Sales Order, etc.

The custom toolbar is in my template, but I can't seem to figure out how to
make it visible in the new document created based on the template. I have
searched through the discussion groups and found what I thought was the
solution but it isn't working.

Private Sub Document_Open()

CommandBars("Faxing from Certiflex").Visible = True

End Sub

This was a solution that I ran across. It seems to make sense, however, it
isn't working!

Any suggestions out there??

Thanks,
Gilley
 
G

Gilley

Charles,

Thanks for the quick response. I was just thinking along those lines.

I am already using the Document_New() to open the text file. I began
thinking that the new document may not be based on my template. After I ran
the Document_New() macro, I checked under Tools/Templates & Add ins. It is
showing NORMAL not CFDRPT.DOT.

How can I force my new document to use the correct template? Let me mention
this also. I am using a VBS script to launch Word and start a new document
based on the template I specify. Here is the code from my VBS file.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim oWord
On Error Resume Next

Set oWord = GetObject("Word.Application")
If oWord Is Nothing Then
Set oWord = CreateObject("Word.Application")
End If

If oWord Is Nothing Then
MsgBox "Could not start Word"
Else
oWord.Visible = True
' the following command must all be one line
oWord.Documents.Add("c:\cfdrptp.dot")
End If
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any suggestions?

Thanks,
Gilley
 
G

Gilley

Thanks Charles. That is what I ended up doing. After your last message, I
started thinking along those lines and added:

ActiveDocument.AttachedTemplate = "c:\cfdrptp.dot"

to the Document_New().

Thanks for your help.

Gilley
 

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