Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: Open file dialog and word documents
Started by matthew.gaskill@tylertech.com at 05-05-2008 10:48. Topic has 3 replies.

Print Search « Previous Thread Next Thread »
  05-05-2008, 10:48
matthew.gaskill@tylertech.com is not online. Last active: 5/13/2008 7:37:46 PM matthew.gaskill@tylertech.com

Top 500 Posts
Joined on 04-08-2008
Posts 9
Open file dialog and word documents
Reply Quote
I am trying to use the Open File Dialog to get the file path to a word document. I get an "Invalid file format error".

I am not trying to load the file, I simply want the file path. I am using leadtools version 14.5

Here is a sample.

Sub FileDialog

Call DialogKernal.InitDlg(0)
DialogKernal.EnableMethodErrors = False


oFileDlg.Filter = "ALL|*.*"
oFileDlg.EnableShowPreview = True
oFileDlg.UIFlags = 64
oFileDlg.FileDlgFlags = 512
oFileDlg.DialogTitle = "Open A File"
oFileDlg.FilterIndex = 0
oFileDlg.InitialDir = "C:\"
oFileDlg.Bitmap = 0

Call oFileDlg.ShowOpenDlg (0)

if oFileDlg.DialogStatus = 100 Then
file.value = oFileDlg.FileName
end if
Call DialogKernal.FreeDlg()
End Sub

What can I do to make this work. It worked in version 13.5; but now does not.
   Report 
  05-06-2008, 16:11
Walter is not online. Last active: 11/13/2008 12:56:37 PM Walter



Top 25 Posts
Joined on 04-14-2008
Charlotte, NC
Posts 116
Re: Open file dialog and word documents
Reply Quote
The problem could be coming from the fact that we don't support reading .DOC files. If an attempt is made to read the file, an error code is going to be kicked back for the reason previously stated. Set the EnableShowPreview to false so that the file isn't attempted to be read.

What does the magic number 100 stand for with respect to the Dialog Status?

If this doesn't fix the issue, I'll need a small sample project that highlights the issue to test with. You can either post to this forum (do not preview the post as it will lose the attachment), or you can also email the project to support@leadtools.com & mention this posting. I need to see a little bit more of the code to get a better idea of what is happening.
Walter
Technical Support
LEADTOOLS
support@leadtools.com
   Report 
  05-13-2008, 14:42
matthew.gaskill@tylertech.com is not online. Last active: 5/13/2008 7:37:46 PM matthew.gaskill@tylertech.com

Top 500 Posts
Joined on 04-08-2008
Posts 9
Re: Open file dialog and word documents

Attachment: filedlg.zip
Reply Quote
I have attached webpage that calls the file dialog.

The "magic number" 100 means dialog status ok. It is documented in the lead tools documentation.

There is not much more code needed to invoke this dialog. This a very simple task. This did work in version 13.5 and now does not in version 14.5
   Report 
  05-14-2008, 10:06
Walter is not online. Last active: 11/13/2008 12:56:37 PM Walter



Top 25 Posts
Joined on 04-14-2008
Charlotte, NC
Posts 116
Re: Open file dialog and word documents
Reply Quote
The reason that it is not working is because the file dialog is assuming that the file will be a bitmap. You can change this assumption by setting the UIFlags to "OPEN_LOADANY". The documentation on flags can be found in the COM object help file under ILEADRasterDlgFile -> Method -> ShowOpenDlg method (ILEADRasterDlgFile)
Walter
Technical Support
LEADTOOLS
support@leadtools.com
   Report 
Post
LEAD Support Fo... » Developer » Common Dialogs » Re: Open file dialog and word documents

Powered by Community Server, by Telligent Systems