Hi All,
I have created a template with word and VBA that takes all the word
docs in a specific folder and allows a user to open the selected
document for edit, when the user goes to edit the document it opens
the document into another template that i created which has a custom
toolbar attached to it and various VBA commands to control the events
on this toolbar. The problem i am having is when the user presses SAVE
on my custom toolbar, the document saves fine however it also saves
the toolbar and all i want is to save the text changes I DON'T want to
save the attached toolbar.. how do i do this? this is the code i have
for saving in my custom toolbar.
ActiveDocument.SaveAs FileName:=docletPath &
ActiveDocument.ActiveWindow.Caption, FileFormat:=wdFormatDocument
docletPath = "C:\Temp\doclet\"
the following is the code i use to open the word document that was
chosen for editing into the second template with the custom toolbar.
Set docApp = New Word.Application
With docApp
.Visible = True
.WindowState = wdWindowStateMaximize
End With
ActiveDocument.ActiveWindow =
docApp.Documents.Open("C:\_dev\CWBL\PensionDocumentBuilder\Retirement\tempDoclet.dot")
docApp.ActiveDocument.ActiveWindow.Selection.InsertFile
FileName:=docletPath & Me.txtSource.Text
docApp.CommandBars("Menu Bar").Enabled = False
docApp.ActiveDocument.ActiveWindow.Caption = Me.txtSource.Text
docApp.ActiveDocument.ActiveWindow.SetFocus
Thanks in advance for the help.
Erin
Jonathan West - 25 Jun 2004 19:41 GMT
Hi Erin,
The toolbar and macro is not saved with the document unless you specifically
take measures top transfer them. What is happening is that the document
remains attached to the template where the toolbar and macro reside. if you
open the document on another computer that doesn't have your template, then
you will find that the toolbar and macro aren't there.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
> Hi All,
> I have created a template with word and VBA that takes all the word
[quoted text clipped - 24 lines]
>
> ActiveDocument.ActiveWindow =
docApp.Documents.Open("C:\_dev\CWBL\PensionDocumentBuilder\Retirement\tempDo
clet.dot")
> docApp.ActiveDocument.ActiveWindow.Selection.InsertFile
> FileName:=docletPath & Me.txtSource.Text
[quoted text clipped - 5 lines]
> Thanks in advance for the help.
> Erin
Chad DeMeyer - 25 Jun 2004 20:14 GMT
Instead of moving the document into your template with the toolbar and
macros, why don't you try temporarily adding the template to the user's
add-ins collection and installing it, then uninstall it and remove it from
Add-Ins collection at the end?
Regards,
Chad DeMeyer
> Hi All,
> I have created a template with word and VBA that takes all the word
[quoted text clipped - 24 lines]
>
> ActiveDocument.ActiveWindow =
docApp.Documents.Open("C:\_dev\CWBL\PensionDocumentBuilder\Retirement\tempDo
clet.dot")
> docApp.ActiveDocument.ActiveWindow.Selection.InsertFile
> FileName:=docletPath & Me.txtSource.Text
[quoted text clipped - 5 lines]
> Thanks in advance for the help.
> Erin
Charles Kenyon - 25 Jun 2004 21:53 GMT
If at the end of your procedures (or in an AutoClose macro) you attach your
ActiveDocument to normal.dot the macros and toolbars should disappear. There
is nothing in your code that would put them into your document.
--
Charles Kenyon
Word New User FAQ & Web Directory:
<URL: http://www.addbalance.com/word/index.htm>
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://www.addbalance.com/usersguide/index.htm>
Word Resources Page
<URL: http://www.addbalance.com/word/wordwebresources.htm>

Signature
See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> Hi All,
> I have created a template with word and VBA that takes all the word
[quoted text clipped - 24 lines]
>
> ActiveDocument.ActiveWindow =
docApp.Documents.Open("C:\_dev\CWBL\PensionDocumentBuilder\Retirement\tempDo
clet.dot")
> docApp.ActiveDocument.ActiveWindow.Selection.InsertFile
> FileName:=docletPath & Me.txtSource.Text
[quoted text clipped - 5 lines]
> Thanks in advance for the help.
> Erin
XmlAdoNewbie - 30 Jun 2004 15:50 GMT
Thanks everyone,
Learn something new everyday!
Erin