|
-
Sep 26th, 2005, 11:52 AM
#1
Thread Starter
New Member
Delete module
HI guys!"
This is my problem:
I have a module in my Word Document. In this module I have an autoClose procedure. I want, that when I close the document it will delete the module and save itself, without asking me the question if I want to save the document. It's supposed to save automatically without asking and then close itself.
Can anyone help me?
-
Sep 26th, 2005, 11:55 AM
#2
Re: Delete module
Moved from ClassicVb.
-
Sep 26th, 2005, 12:00 PM
#3
Re: Delete module
Welcome to the Forums.
My code example in CodeBank should give you a running start on a solution.
Modify Macro Code From VB6
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 26th, 2005, 12:08 PM
#4
Thread Starter
New Member
Re: Delete module
Yeah, it deletes the module. That works.
But it asks me if I want to save the changes, but I don't want him to ask me that. He is supposed to save it automatically after deleting the module.
-
Sep 26th, 2005, 12:14 PM
#5
Re: Delete module
Then place code to save the doc or to bypass it and not save.
VB Code:
ActiveDocument.SaveAs FileName:="C:\Test.doc"
ActiveDocument.Saved = True
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 26th, 2005, 12:43 PM
#6
Thread Starter
New Member
Re: Delete module
yeah, but it doesn't work, because it's in the module that'll be deleted too.
Is there a way to still save the document automatically somehow?
-
Sep 26th, 2005, 12:47 PM
#7
Re: Delete module
ActiveDocument.Save will save the document but if it hasnt been saved yet, new doc, it will prompt you for filename and location.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|