|
-
Mar 26th, 2006, 11:30 AM
#1
Thread Starter
Junior Member
How to save/export my formatted report from Access-DB to Word-File?
hi, all!
It's a simple question. I'm sorry, but I couldn'd find an answer in this forum
I have formatted several nice reports.
Could you be so kind to help me in VBA to save/export for example my Report1 from DB1.mdb to Report.DOC (I need to save format of pages too: fonts, colors, footers, etc...).
Code/example would be very much appreciated
thanks in advance!
kind regards.
Baloo.
Last edited by Baloo; Mar 26th, 2006 at 11:35 AM.
-
Mar 26th, 2006, 03:50 PM
#2
Re: How to save/export my formatted report from Access-DB to Word-File?
In Access, Tools > Office Links > Publish It with Microsoft Office Word.
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 
-
Mar 27th, 2006, 01:23 AM
#3
Thread Starter
Junior Member
Re: How to save/export my formatted report from Access-DB to Word-File?
hi RobDog,
thanks a lot, but I need to do it in Access VBA programmatically.
could you be so kind to show me VBA-code?
kind regards,
Baloo.
Last edited by Baloo; Mar 27th, 2006 at 01:32 AM.
-
Mar 27th, 2006, 10:26 AM
#4
Re: How to save/export my formatted report from Access-DB to Word-File?
You can use Application.DoCmd.RunCommand acCmdOutputToRTF after your report is opened.
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 
-
Apr 4th, 2006, 08:45 AM
#5
Thread Starter
Junior Member
Re: How to save/export my formatted report from Access-DB to Word-File?
hi,
RobDog888, thanks a lot once more! but I have three more questions
I've used:
VB Code:
DoCmd.OutputTo acReport,"repMyReport", acFormatRTF, "C:\MyDoc.doc", False
and it works, but in this case: Word can't save all formats of my report fields /colors of fields from Detail-region/ That's why I have to use - acCmdOutputToRTF
also about -
VB Code:
Application.DoCmd.RunCommand acCmdOutputToRTF
1) how to save my Report in the definite path, for example "C:\MyReport.DOC"? Unfortunately I can't use reference to MS-Word, because my each user have different Word-version
2) and can I do it in general without opening Word-application?
3) it displays the Database Window which I want to keep hidden from the users?
Any help or hints would be most appreciated
kind regards,
Baloo.
Last edited by Baloo; Apr 4th, 2006 at 08:53 AM.
-
Apr 4th, 2006, 09:29 AM
#6
Re: How to save/export my formatted report from Access-DB to Word-File?
You can use Late Binding to accomodate multiple versions of Word.
When using RunCommand acCmdOutputToRTF you can not specify a directory path via code.
So basically you want to output a Word report without Access being visible and how about Word?
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
|