用f1book1.SaveFileDlg,能运行,但磁盘上为何没有文件存在????(100分)

N

nhwc

Unregistered / Unconfirmed
GUEST, unregistred user!
源程序:
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
j:boolean;
h:widestring;
k:smallint;
begin
table1.open;
i:=1;
while not table1.eof do
begin
inc(i);
f1book1.textrc[i,1]:=table1.fieldbyname('reno').asstring;
f1book1.row:=i;
f1book1.col:=2;
f1book1.FormatMdyy;
f1book1.TextRC[i,2]:=table1.fieldbyname('teldate').value;
table1.next;
end;
f1book1.maxrow:=i;
f1book1.maxcol:=2;
f1book1.SaveFileDlg('',h,k);
end;
 
F1Book1.SaveFileDlg pTitle, pBuf, pFileType
是打开保存文件的对话框,找到要保存的文件路径!如果要保存文件的话,应该使用Write
或者WriteEx来实现!
下面是一个例子!
Try
Formulabook1.SaveFileDlg('',fCurrentVtsFilePath,fFiletype);
Formulabook1.Write(fCurrentVtsFilePath, fFiletype);
Except
MessageDlg('保存文件失败!',mtWarning,[mbOk],0);
End

下面是formulabook中的例子!
Dim fInfo As New F1FileSpec

F1Book1.SaveFileDlgEx "", fInfo
F1Book1.WriteEx fInfo.Name, fInfo.Type

 
THS!THS!THS!
 
顶部