Results 1 to 8 of 8

Thread: select table then display in word

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    260

    select table then display in word

    im using vs 2005 language vb
    i'm trying to select * from a table. then display those information in word with a certain font and template in word. How do i do that? could anyone help me? thank you very much

  2. #2
    Addicted Member ThatSamiam's Avatar
    Join Date
    Apr 2007
    Posts
    128

    Re: select table then display in word

    I would use the clipboard to paste the data in Word.

    When working in Word or Excel, I usually create a macro, perform all the steps I want to happen, then make use of the macro generated VB code.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: select table then display in word

    You might want to start with the Word and .NET sections in my FAQ - http://vbforums.com/showthread.php?t=358585
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    260

    Re: select table then display in word

    maybe you guys misunderstood my question or i didnt understand your answer. but
    my question is like this:

    i have a table in the sql server. so now i want to select all rows in that table. and then output it into word using vb 2005

    table
    column 1 column 2 column 3
    1 Hey Now
    2 YO What

    output in word

    1 Hey Now 2 Yo What
    Hey Now Yo What

    please help

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: select table then display in word

    Yes, I completely understood. What type of word document do you need? A MailMerge? If so then setup your mailmerge to connect to the sql table and place the fields in your document. Run the MM or automatically invoke it by opening the document with a proces.start.

    MailMerge documents is a FAQ item in my Office Dev FAQ.
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    260

    Re: select table then display in word

    one of those easy peel labels so you could print your address on it like this
    Code:
    hello smith                     hello smith
    123 wood ave                    123 wood ave
    worcester, ma 01606             worcester, ma 01606
    etc....

    i just want to see it likes that on ms word. i dont need to mail merge or do anything else. thank you
    Last edited by dummies2; Nov 13th, 2007 at 08:44 AM.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    260

    Re: select table then display in word

    mail merge seems to be correct. but what i want to do is write code in vb 2005 and shoot out the information from database then opens up in ms word and have format as label type.

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: select table then display in word

    Um, using a pre-created formatted document made by you or create it all on the fly?
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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
  •  



Click Here to Expand Forum to Full Width