Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textmerge in VBA

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
Hi all

Would appreciate a translation to VBA code of the following VFP code.

In pseudocode, create the text file C:\temp\reportname.txt by turning on TEXTMERGE, hiding the output with NOSHOW, insert the string 'D:\My Application\Report output.pdf' on the first line, close the text file and turn TEXTMERGE off.

SET TEXTMERGE ON TO C:\temp\reportname.txt NOSHOW
\\D:\My Application\Report output.pdf
SET TEXTMERGE OFF
SET TEXTMERGE TO


FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Well, if I understand what you want there may be a few ways but this is one:

Open the file that you want to write the string to...
Open C:\temp\reportname.txt For Output As #1
(If the file does not exist, using the "Output" mode will create it)

Then write the String to the file...
Write #1, "\\D:\My Application\Report output.pdf"

But don't forget to close the file...
Close #1

 
ssVBAdev

Thanks for your response - I am sure that will suffice.

The '\\' is VFP's way of appending a line to the file, the text following becoming the content of the first line.

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top