Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using general fields
Message
From
03/08/1999 06:54:20
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/08/1999 13:07:15
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00248424
Message ID:
00249141
Views:
20
>>>We are rewriting our FPW2.6a application in VFP 6.0 sp3, and are in need
>>>of some help with the following situation.
>>>
>>>The application prints several forms (created using the report designer)
>>>which have fixed amounts of space for comments. In 2.6a, we used memo
>>>fields for these comments, and were able to use _mline, memlines, etc.
>>>to determine whether the contents of the field would fit in the space
>>>allowed on the form. If it doesn't fit, "See Attached" is printed in
>>>the box on the form instead, and a separate page is printed for the
>>>comments.
>>>
>>>Due to customer demand for the ability to format the text, we are trying
>>>to use general fields (embedded OLE; MS Word) for these comments in the
>>>new application. Is there a way to determine how many lines of text are
>>>contained in these fields? Is there some other way to achieve the
>>>behavior described above and still have support for text formatting like
>>>bold, underline, TAB?
>>>
>>>Any suggestions very much appreciated!
>>>TIA!
>
>>Bridget,
>>Review the thread titled "How can I simulate a streching field in footer band"
>>posted the same day.
>
>
>Thanks, Cetin, but that isn't quite what I need. The main problem is how do I get at the text that's embedded in a general field? (sorry if that wasn't clear)
>
>>But since it's using formatting word it means your user has word. Why not
>>directly use it for reporting. There has been many threads about it in the
>>past. Also look at mailmerge class in files\classes section if you didn't
>>install MDAC2.1 (it doesn't support foxpro 2.x tables anymore).
>
>We are using Word for some of the simpler print jobs (like form letters), but the items in question here have already been designed in the report writer (we are actually just re-using the FPW2.6 reports, since only the fields on them need to be changed), and they are too much of a pain to format properly in Word. They are replicas of pre-printed loan documents, and require a degree of precision in the placement of lines, etc. that is far easier to accomplish in the report writer.

So mainconcern is to save as text from embedded word doc. Here is a piece of code to do it. Ps note that form is never shown (with little modification this could be in init event code of a form that's returning .f. too) :
CREATE cursor wtest (wf g)
APPEND blank
APPEND general wf from ("c:\my documents\mydoc.doc")
oform = createobject("form")
WITH oform
  .addobject("olbW","Oleboundcontrol")
  .height = 420
  .width = 620
  WITH .olbW
    .top = 10
    .left = 10
    .height = 400
    .width = 600
    .controlsource = "wtest.wf"    		&& Embedded word doc
    .object.saveas("c:\temp\savedfromgen.doc",wdFormatText)  && saved to disk
  ENDWITH
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