DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: pass the content of text box to Word

  1. #1
    Join Date
    Jun 2008
    Posts
    12
    Please show me who to pass the content of text box to Word

    Ex: text1="Irfan"

    in MS-Word it should be
    Name : Irfan

    Please help

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Split into its own thread

    Use bookmarks.

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Your duplicate of this thread has been deleted - please post each question only once (if you think you have posted in the wrong forum section, please PM a moderator and ask them to move it for you.) Thank you.

    Are you familiar with using Word Bookmarks?

  4. #4
    Join Date
    Jun 2008
    Posts
    12
    No

  5. #5
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263
    You could also use Automation. This is a good article:
    How to Use (OLE) Automation with Word

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    In your Word document, click on the spot that you need to populate from your VB program (you will need to repeat this step for each location within the document that text will be inserted). Next, click from the Word menu - Insert/Bookmark

    You will need to give the bookmark a name. Each bookmark will need to have a unique name. Then, from your VB program, you can pass the contents of a textbox to a specific bookmark name on your word document.

  7. #7
    Join Date
    Jun 2008
    Posts
    12
    Hi,
    I got your repaly, But my problem i will explain below

    In a VB form have two labels and two textboxs i.e Label1 contain Name and
    Label2 conatin Address.

    I will enter the name and Address in textbox.

    That Name and Address of textbox I want to display in word on different location

    ex: Name : Rafiq
    Address : Poona India

    how to display this please send me coding

    please help

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Here is an example. You will need to modify this to fit your specific needs.
    Code:
    Dim WordObject As Word.Application
    Set WordObject = CreateObject("Word.Application")
    
         With WordObject
         .Documents.Open ("c:\yourdocument.doc")
         .ActiveDocument.Bookmarks("Bookmark1").Select     
         .Selection.Text = (Label1.Caption)
         .ActiveDocument.Bookmarks("BookMark2").Select
         .Selection.Text = (Text1.Text)     
        End With
       WordObject.Visible = True
           WordObject.ActiveDocument.PrintOut Background:=False
           WordObject.ActiveDocument.SaveAs FileName:="x.doc"
           ' setting the printing to background will display the document
           ' on the screen while it is being printed
           ' WordObject.Documents.Close '("c:\yourdocument.doc")
        WordObject.Application.Documents.Close
        Set WordObject = Nothing

  9. #9
    Join Date
    Jun 2008
    Posts
    12

    Thanks Hack

    I received you mail and got the solution
    thanks for your guidence and support

  10. #10
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Whose mail?

  11. #11
    Join Date
    Jun 2008
    Posts
    12

    How to Sort a list

    i have textbox and list on form

    from textbox i enter the name. list will display all the existing name in the list.

    suppose the name enter in textbox which is already existing in the list suppose i enter from the textbox it should select first record of the list and when list display the list should be in sorted order


    please explain above ex ; by CODING

  12. #12
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Are you talking about a textbox on your VB form that goes to your bookmarks, or a textbox on your Word Document?

    What is this "list" you are referring to?

  13. #13
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263
    I found this sample project in FreeVBCode.com. It sounds just like what you are looking for:
    AutoComplete Text Box Version 1.01
    When you follow this link, read the description on what this project does. It sounds just like what you are looking for.

  14. #14
    Join Date
    Jun 2008
    Posts
    12

    How to create menu by coding

    Please help me how to create menu by coding in VB 6.0
    on MDIform

  15. #15
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263
    VB6 has a menu editor. Open the form you want to add a menu to and then
    select the Menu Editor from the Tools Menu or type Ctrl E.

Similar Threads

  1. Replies: 4
    Last Post: 11-28-2005, 03:14 PM
  2. Text box validate on Access Please help
    By benz84 in forum VB Classic
    Replies: 2
    Last Post: 11-14-2005, 05:38 AM
  3. ? Centering text vertical in a text box
    By Patrick Ireland in forum .NET
    Replies: 2
    Last Post: 07-22-2002, 02:36 PM
  4. HELP!! uncovering hidden dialog box
    By TC in forum VB Classic
    Replies: 0
    Last Post: 09-29-2000, 11:53 AM
  5. Hiding the text in Rich Text Box
    By Javaid Ahmad in forum VB Classic
    Replies: 0
    Last Post: 04-13-2000, 11:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center