|
-
Jul 28th, 2006, 11:02 AM
#1
Thread Starter
Member
VB.NET and word automation..
From a webform, i wish to get some data and use it to populate a word document that i have with merged fields (which were set up through mail merge feature).
So far i have been able to create a word object and open the document. Now i am stuck at the part where i import specific data on the webform to particular merged fields in the word doc. Data in the webform will be held in variables so i need to tell the application to match a particular variable to a particular merged field in the word doc, but how do i do this??
This is how far i have got:
VB Code:
'create an instance of the application
Dim wordApp As Word.Application
'create new document
Dim wordDoc As Word.Document
wordApp = CreateObject("Word.Application")
wordDoc = wordApp.Documents.Open(FileName:="c:\labeltemplate.doc")
please help
-
Jul 28th, 2006, 11:04 AM
#2
Re: VB.NET and word automation..
Your webform should be writting the data out to a database or such so that you can read it back in anytime for use in any app etc.
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 
-
Jul 28th, 2006, 11:47 AM
#3
Thread Starter
Member
Re: VB.NET and word automation..
I am not sure that i need to do this as the webform only provides the data for specifically populating the word doc.
But if i am not 100% sure i understand what you mean
-
Jul 28th, 2006, 12:12 PM
#4
Re: VB.NET and word automation..
The User is going to need to have word installed and depending on the code, if any server side word automation is to be done, the server will need word also.
But he original question is that its better to store the data in cookies or textfiles or a database as if they encounter a problem or accidentally close the page you will have what they have already done so far saved.
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 
-
Jul 28th, 2006, 12:17 PM
#5
Thread Starter
Member
Re: VB.NET and word automation..
ok, the underlying data in the webform is already in a access database so where do i go from there?
-
Jul 28th, 2006, 12:24 PM
#6
Re: VB.NET and word automation..
Your webform will read out the data and write it to Word. Is it a template document or varying data formats?
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 
-
Jul 28th, 2006, 12:38 PM
#7
Thread Starter
Member
Re: VB.NET and word automation..
it is word document (.doc) with merge fields in it.
-
Jul 28th, 2006, 12:43 PM
#8
Re: VB.NET and word automation..
Then you would execute the merge based upon the datasource query to the database. When you open the doc it will prompt to execute it and then your done.
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 
-
Jul 28th, 2006, 03:22 PM
#9
Thread Starter
Member
Re: VB.NET and word automation..
im quite a beginner so could you possibly provide a sample on how this is done?
Thanks!
-
Jul 28th, 2006, 03:34 PM
#10
Re: VB.NET and word automation..
Your using ASP.NET right? Which version?
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 
-
Jul 30th, 2006, 06:13 AM
#11
Thread Starter
Member
Re: VB.NET and word automation..
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
|