|
-
Sep 17th, 2005, 10:38 AM
#1
Thread Starter
Hyperactive Member
Saving a Document with another name [resolved]
In my application i open up a document in word with the following code, once i do all of my precessing on that document using my vb app, how do i get Word to save the file with a different name. Example Abc.doc gets saved as completedproject.doc.
VB Code:
With WordObject
.Documents.Open ("c:\abc.doc")
End With
Thanks for you help.
Last edited by mrstuff68; Sep 20th, 2005 at 01:54 PM.
-
Sep 17th, 2005, 12:13 PM
#2
Re: Saving a Document with another name
Moved from Calssic VB forum.
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 17th, 2005, 12:19 PM
#3
Re: Saving a Document with another name
You can use the .SaveAs method to save the current document as whatever filename you want but that still leaves the document thin king its not saved so you can use the .Saved property to make it think its saved.
VB Code:
With WordObject
.Documents.Open ("c:\abc.doc")
'Do some stuff to the doc
'Blah, blah, blah....
'Save document as something else
.Documents("C:\abc.doc").SaveAs FileName:="C:\SomethingElse.doc"
.Documents("c:\abc.doc").Saved = True
End With
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 20th, 2005, 01:54 PM
#4
Thread Starter
Hyperactive Member
Re: Saving a Document with another name
Thanks RobDog888, exactly what i was looking for.
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
|