Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

UNSAVE MACROS CODE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alok - 18 Nov 2004 08:49 GMT
Hi ,

I have written few macros in a document which finally creates a new document
prgrammatically.

Please tell me how to EXCLUDE the macros code in the new document created.
Jonathan West - 18 Nov 2004 10:16 GMT
Hi Alok

Code is not stored in a dcument when you create it using the Documents.Add
method. However, then the document is open, macros stored in the template it
is based on are still available for use. But the macros will not be
available if you send the document to another computer that does not have
the template.

This article may help you

What do Templates and Add-ins store?
http://word.mvps.org/FAQs/Customization/WhatTemplatesStore.htm

Signature

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

> Hi ,
>
[quoted text clipped - 3 lines]
>
> Please tell me how to EXCLUDE the macros code in the new document created.
Alok - 26 Nov 2004 09:35 GMT
Hi Jona
I am not using document.add method to add the template but the saveas method
with the active document .but its still saving the macros as well.
I do not want to save the macros with the new doc.

Thanx for your help,anyways.
Regards,
alok

> Hi Alok
>
[quoted text clipped - 16 lines]
> >
> > Please tell me how to EXCLUDE the macros code in the new document created.
Jonathan West - 26 Nov 2004 10:30 GMT
> Hi Jona
> I am not using document.add method to add the template but the saveas
> method
> with the active document .but its still saving the macros as well.
> I do not want to save the macros with the new doc.

If you use SaveAs to save a document under a new name when the document
contains macros, then the new file will also contain macros. But are you
sure your original document does contain macros? By default macros get saved
in a template, not a document, and are available to all documents based on
that template.

If the document does contain macros, I would strongly recommsn you change to
to being a template, and then create new documents based on it using the
Documents.Add method. Documents created by this route definitely do not
contain macros.

Signature

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

Alok - 30 Nov 2004 07:27 GMT
Hi Jon
I could save the macros in the .doc file and not in the normal.dot file.

I am also not too sure about document.add method if it only adds templates
to self.

If i save the ORIGINAL doc as .dot file and the tried saving the NEW file as
.doc file.
It works !!! as it does not contain macros .

BUT IT STILL adds the original file as a reference to the new doc.when i go
to  alt+F11 (vba code editer).

Hope i am making myself understandable .

Thanks,
Alok

> If you use SaveAs to save a document under a new name when the document
> contains macros, then the new file will also contain macros. But are you
[quoted text clipped - 6 lines]
> Documents.Add method. Documents created by this route definitely do not
> contain macros.
Jonathan West - 30 Nov 2004 09:12 GMT
> Hi Jon
> I could save the macros in the .doc file and not in the normal.dot file.
[quoted text clipped - 12 lines]
>
> Hope i am making myself understandable .

No really. Forget about what you are doing in VBA at the moment. Simply
describe the overall task and the effect you are trying to achieve.

Signature

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

Alok - 02 Dec 2004 10:55 GMT
Ya Jon
Actually i want to have a dot file with macro .
Which when opened should open a new document with the same content and load
my macro wizard.
but this new file should NOT have any reference to the macros in the
vbaeditor.

Thanks Jon for the effort.
I really appreciate.

> > Hi Jon
> > I could save the macros in the .doc file and not in the normal.dot file.
[quoted text clipped - 15 lines]
> No really. Forget about what you are doing in VBA at the moment. Simply
> describe the overall task and the effect you are trying to achieve.
Jonathan West - 02 Dec 2004 16:39 GMT
> Ya Jon
> Actually i want to have a dot file with macro .
[quoted text clipped - 6 lines]
> Thanks Jon for the effort.
> I really appreciate.

If you duse the Documents.Add method to create a document based on your
template, any toolbars and macros will be available to the user because the
document will be based on the template.

but the toolbars and macros are not stored in the document, so when you save
it and email it to someone without the template, they will not have your
macros.

This article may help you understand what is going on

What do Templates and Add-ins store?
http://word.mvps.org/FAQs/Customization/WhatTemplatesStore.htm

Signature

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.