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

Re: Saving Word Document without Attached macro by Jonathan

Jonathan
Fri Jun 25 13:41:18 CDT 2004

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.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

"XmlAdoNewbie" <erin.sebastian@cowaninsurancegroup.com> wrote in message
news:c90f3d38.0406251006.1bb12e15@posting.google.com...
> 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\tempDo
clet.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


Re: Saving Word Document without Attached macro by Chad

Chad
Fri Jun 25 14:14:34 CDT 2004

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


"XmlAdoNewbie" <erin.sebastian@cowaninsurancegroup.com> wrote in message
news:c90f3d38.0406251006.1bb12e15@posting.google.com...
> 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\tempDo
clet.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



Re: Saving Word Document without Attached macro by Charles

Charles
Fri Jun 25 15:53:39 CDT 2004

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>

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.

"XmlAdoNewbie" <erin.sebastian@cowaninsurancegroup.com> wrote in message
news:c90f3d38.0406251006.1bb12e15@posting.google.com...
> 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\tempDo
clet.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



Re: Saving Word Document without Attached macro by erin

erin
Wed Jun 30 09:50:11 CDT 2004

Thanks everyone,
Learn something new everyday!
Erin