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.
1 Attachment(s)
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
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
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
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
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
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....