Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Crystal to link up Word documents
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Divers
Thread ID:
00805867
Message ID:
00805958
Vues:
26
Hi Nirav, Nice Name,

I picked up this code from one of the threads in UT, Hope this can help.

Make a form Function say SendToWord call from the form command click like
thisform.sendtoword(thisform.edit1,"c:\1.doc")
FORM FUNCTION SENDTOWORD
Lparameters oMemo, cFilename
** parameters are the editbox object and a filename to keep a copy
** filename is not really necessary.
lcObject=Sys(1272, oMemo)
lcObject=Strtran(lcObject, Getwordnum(lcObject, 1, "."), "thisform")
This.cobjectforword=lcObject
_Cliptext=""
_Cliptext=oMemo.Value
This.cdocfilename=Fullpath(cFilename)
	With This.oword
		.documents.Add.Content.Paste
** this is just the special needs of my app - set language to English (US)
		.documents.Item(1).Content.Select
		.Selection.LanguageID = 1033
		.Selection.NoProofing = .F.
		.Application.CheckLanguage = .F.
** end special
		.documents.Item(1).SaveAs(This.cdocfilename)
		.Visible=.T.
	Endwith
Messagebox("Now Alt-tab to bring up Word. Return here and click OK when finished with Word (don't close it)")
Make another Commadn Button and call the Word text in it.
If Type("Thisform.oword.documents")="O" and;
	Thisform.oword.documents.count>0 and ;
	Not Empty(Thisform.cdocfilename) 
	*And Not type(Thisform.cobjectforword)="O"
	With Thisform.oword
		With .documents.Item(1)
			.content.select()
			.content.Copy()
			.Save()
		Endwith
		.documents.Close
		.Visible=.F.
	Endwith
	Local oEditbox
	oEditbox=Evaluate(Thisform.cobjectforword)
	oEditbox.value=_cliptext
	oEditbox.SetFocus()
	Store "" To Thisform.cdocfilename, Thisform.cobjectforword
Endif
You need few form properties like
Thisform.oword
Thisform.cdocfilename
Thisform.cobjectforword
Once you have data from word you can go for crystal report.
Aashish

>Hello,
>
>My question is regarding using Crystal Reports to link multiple Word documents together. We need it such that we can make changes to the Word files, and the Crystal report will automatically reflect these changes (the next time it's opened). Turns out that this is a not so simple task. I thought that I could use the FoxPro 'General' field type to store a link to the Word document like this:
>
>APPEND GENERAL tgeneral FROM W:\ICOSNPD\acord.doc LINK CLASS "Word.Document.6"
>
>Well, that apparently isn't very efficient and creates large .FPT files. Still, I suppose I'd be willing to deal with that.
>
>After this, I figured I could just drag the general field onto the Crystal Report and it would work like I wanted. Well, not much luck here. The rpt doesn't seem to be getting updated when I make changes to the original Word document. I noticed that if I embed the Word file in the General field, then it seems to work how I want it, but then that brings up a whole lot of other problems.
>
>What is the best route I can take with this? I wish there was a way I could just store the paths to the files (which actually are already stored elsewhere in the database) and just tell Crystal where to find the Docs.
>
>Any help will be greatly appreciated. Thanks!
>
>We're using FoxPro 6.0 and Crystal 8.5
--
--
Aashish Sharma
Tele Nos: +1-201-490-5405
Mobile: +91-9821053938
E-Mail:
aashish@aashishsharma.com
write2aashish@gmail.com

You better believe in yourself... if you don't, who else will ?
TODAY is a gift, that's why it's called PRESENT
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform