CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2004
    Posts
    55

    Smile send text and picture to file (WordDoc)

    hello,



    I am stuck up with a problem. I need to send record set data as well as image to word document dynamically.For this problem could some one please provide me solution.



    1.Is it possible with to send image/picture to file using Scripting.FileSystemObject and writeline method.
    2. without using either bookmarks or range can i insert spaces before text using word.application so that i can send text and images without preformated template.

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Text in a Table and an Image from file to word

    The attached project is able to write a doc:

    puts data (from recordset) in a Table and
    an Image (from a file) into a new word doc

    Enjoy
    Attached Files Attached Files
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Oct 2004
    Posts
    55

    Smile hide tablle gridlines

    hello,

    i am working with creating of word document using tables.how can i hide table gridline,i.e just showing text of the table.


    thanks in advance
    karuna

  4. #4
    Join Date
    Sep 2004
    Location
    Sandhem, Sweden
    Posts
    20

    Re: hide tablle gridlines

    Hi.

    Are you creating the document by hand or with an app/macro?

    In case you're doing it by hand, just select the table. Right-click and select "Borders and shading". Under the tab "Borders" select the setting "None", then just press "Ok".
    Your borders have disappered.

    In case you're doing it by code:

    Code:
    ThisDocument.Tables( iTable ).Borders( iBorder ).Visible = False
    Where "iTable" is the index to the table, and "iBorder" is one of the border constants "wdBorderBottom", "wdBorderLeft", etc.

    I think that should work.

    Regards,
    Michael

  5. #5
    Join Date
    Oct 2004
    Posts
    55

    working with word tables using visual basic

    hello,


    sorry for not posting question properly. Using visual basic i am automating word document dynamically. i need to create table hiding grid lines i.e horizontal and vertical lines. Also i need to create another table with two columns .Though i had given wrdApp.Selection.EndKey unit:=wdStory and trying to create table .....the second table is creating befor the first table.

    Sorry for asking such a big lengthy question.I would be greatful if any one could pl. help me show a link to any article or giving me piece of code to work with automating word and formating word body i.e using one table after another hiding lines so that text is formatted and looks neat.


    thank a lot
    karuna

  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Merged all, as they all refer to this...

    Please, post inside this thread, unless you're asking for something
    completely different...

    An easy way to get clue on how to perform what you want is using
    Macro-recprder from word:
    Open a doc, search menu for MAcro, register one (for current doc, not for
    Normal.Dot!), Insert a table, make border transparent. When you have done,
    stop registering macro.
    Now go to same menu and see: Vb editor.
    Choose it, and via Project explorer go o see the module that has been added.
    There you will find VBA code, which is quite the same as Vb and a good starting
    point to learn how to deal with Word inside Vb
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  7. #7
    Join Date
    Oct 2004
    Posts
    55

    send text and picture to file (WordDoc)

    Hello,

    Recordset data contains rtf format hence when i am using

    wrdselection.typetext rec(0)

    where wrdselection is word.selection type

    following is saved in my word document .How can just get text part from the below rtf format.

    {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Verdana;}}
    \viewkind4\uc1\pard\f0\fs20 (I)Give two uses of convex and concave Mirror.[2]
    \par (II)Calculate the number of images formed when object is placed between two plane mirrors inclined at a angle of 60 degree[2]\fs20
    \par }



    thankyou
    karuna

  8. #8
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: send text and picture to file (WordDoc)

    A trick is:
    Save it with a different name in plain text. read the different file name and get the
    text.
    Another is:
    Select all, assign it to the Textrtf property of a hidden richtextbox
    and then get the Text proprety from it
    A third way :
    Look to see if you can find a word property or a word method that gan give you
    text instead of rtftext....
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured