Hi Guys,

Can any one give suggestions on it please? Ours is a big organisation
with almost 100 printer. I have written macro which checks the driver
name and assign the different trays. I have written if statements for
each printer but in the future if new printers are added I dont want
MAcro to be changed much. So I think it will be good if I store all
the printer details as a text file and test with driver name and
Assign the tray numbers.

Actual Requiremenet: I just want to know how do we test a particular
column of a text file in a Word Macro

Anyone please

RE: Testing a text file in Word Macro by Bear

Bear
Mon Apr 16 10:24:01 CDT 2007

Mushy:

I cannot understand your application from the description:

> Actual Requiremenet: I just want to know how do we test a particular
> column of a text file in a Word Macro

You can certainly store printer details in a table in a Word document, and
open and manipulate the contents of that document and table. You can show the
document or open it "invisibly."

Set docPrinterData = Documents.Open( _
FileName:="Xxx.doc", _
Revert:=False, _
Visible:=False)

and then manipulate docPrinterData.Tables(1)

Bear


Re: Testing a text file in Word Macro by Jonathan

Jonathan
Mon Apr 16 11:38:40 CDT 2007


"Mushy" <mushtaq.netdeveloper@gmail.com> wrote in message
news:1176725924.258116.133600@o5g2000hsb.googlegroups.com...
> Hi Guys,
>
> Can any one give suggestions on it please? Ours is a big organisation
> with almost 100 printer. I have written macro which checks the driver
> name and assign the different trays. I have written if statements for
> each printer but in the future if new printers are added I dont want
> MAcro to be changed much. So I think it will be good if I store all
> the printer details as a text file and test with driver name and
> Assign the tray numbers.
>
> Actual Requiremenet: I just want to know how do we test a particular
> column of a text file in a Word Macro
>
> Anyone please
>

Hi Mushy

There are various options here. The simplest is to use the basic file i/o
commands to get the text of the file into a string variable, and then
manipulate the variable. Take a look at the following commands in the VBA
Help

Open
Line Input
Input #
Get #



--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org


Re: Testing a text file in Word Macro by Mushy

Mushy
Wed Apr 18 08:47:29 CDT 2007

On 16 Apr, 17:38, "Jonathan West" <j...@mvps.org> wrote:
> "Mushy" <mushtaq.netdevelo...@gmail.com> wrote in message
>
> news:1176725924.258116.133600@o5g2000hsb.googlegroups.com...
>
> > Hi Guys,
>
> > Can any one give suggestions on it please? Ours is a big organisation
> > with almost 100 printer. I have written macro which checks the driver
> > name and assign the different trays. I have written if statements for
> > each printer but in the future if new printers are added I dont want
> > MAcro to be changed much. So I think it will be good if I store all
> > the printer details as atextfileand test with driver name and
> > Assign the tray numbers.
>
> > Actual Requiremenet: I just want to know how do we test a particular
> > column of atextfilein a Word Macro
>
> > Anyone please
>
> Hi Mushy
>
> There are various options here. The simplest is to use the basicfilei/o
> commands to get thetextof thefileinto a string variable, and then
> manipulate the variable. Take a look at the following commands in theVBA
> Help
>
> Open
> Line Input
> Input #
> Get #
>
> --
> Regards
> Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> Please reply to the newsgroup
> Keep yourVBAcode safe, sign the ClassicVB petitionwww.classicvb.org

Thanks Jonathan,

I will look at it