Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export to WORD
Message
From
15/04/2002 12:37:25
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/04/2002 12:05:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00644987
Message ID:
00645058
Views:
13
>Cetin,
>
>I have only a single EMPLOYEE.dbf and don't need *.dbc in th cDSN, How can I
>modify your codes to insert two fields such as Empno, Name to export to WORD,
>in the line
> .range.insertdatabases(,,,cDSN,lcSQL) should be changed to accept only Empno,Name fields
>
>Please correct your code to do this.
>TIA
>Paul
use employee
lcTemp=sys(2015)+'.txt'
copy fields empno, name to (lcTemp) type csv
lnFields = 2
_ClipText = chrtran(FileToStr(lcTemp),'"','')
erase (lcTemp)
#define wdSeparateByCommas  2

oWordDocument=createobject("word.application") && Create word object
WITH oWordDocument
  .documents.add && New file
  WITH .ActiveDocument
    .Range.Paste
    .Range.ConvertToTable(wdSeparateByCommas,,lnFields)
  ENDWITH
  .visible = .t.
  .Activate
ENDWITH
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform