Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
specifying app when opening file in SHDocVw.WebBrowser
#1
Hi Gintaras,
I use SHDocVw.WebBrowser in a dialog to view mostly pdf's but also powerpoint and xls and word docs using setwintext. Sometimes I would like to specify which type of program they open up in the dialog window. For example, Adobe Reader does a lot of things I don't like and there is some very light alternative pdf readers. Also some don't have Powerpoint, but you can always open Poweroint .ppt files in PowerPoint Viewer even if not .pps (Powerpoint Presentation only files). I thought that maybe QM checks what is the default program for that file extension but I changed it in windows but the QM dialog still chooses the typical program as before.
Any suggestions?
Thanks so much!
Stuart
#2
Web browser control should open documents exactly like Internet Explorer. QM cannot change it.
#3
Is there another type of dialog control that could be used for opening various types of docs within a child window of the dialog. You probably knew that was going to be my next question ;-)
When I think about it you can open up many docs in an IE browser window so most of that programming must already be done in IE, and therefore could be quite difficult in QM...but thought I would ask.
S
#4
Only web browser control can open documents of multiple types.
#5
Thanks for your help on this tough problem. I am using the SHDocVw.WebBrowser in a dialog to view mostly pdf's but also powerpoint and xls and word docs using setwintext. It works great for PDFs. I can load Powerpoint files as either "Presentations (.ppt) or Shows (like kiosk-mode - free viewer) just by changing file extension of .ppt to .pps. But the only problem is that every time I change slide, a dialog pops up
Quote:This document has been modified. Do you want to save changes?
Yes: Save your chanes
No: Discards your changes
Cancel: Keeps this document open

I have read online and many people describe this problem...mostly with online excel spreadsheets.
One solution I read was to make sure the folder is "read only". THe location I am using IS "read only"
Another suggested this won't work because the WebBrowser control copies it to a temp location which is considered "new".
I can't use a window trigger to
Code:
Copy      Help
clo
the window because it may be in executable.
Any thoughts.
If web browser control doesn't work, is there a different type of dialog window that can be used to show office documents (and pdfs).
Thanks!!
Stuart
#6
I am trying to figure out whether this will help:
http://www.pptfaq.com/FAQ00189.htm
Stuart
#7
I'm sorry...I think I asked a question you already answered. I understand that only a browser can open many different t types of documents but is there a way to have a dialog for just ppt/pps?
S
#8
If web browser control uses MS Office Powerpoint to show ppt (in dialog), you can access Powerpoint COM and try to find a function that does what you need.

Function dlg_powerpoint
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str ax3SHD
ax3SHD="$documents$\Title.ppt"
if(!ShowDialog("dlg_powerpoint" &dlg_powerpoint &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 224 134 "SHDocVw.WebBrowser"
;END DIALOG
;DIALOG EDITOR: "" 0x2030300 "" "" ""

ret
;messages
typelib PowerPoint {91493440-5A91-11CF-8700-00AA0060263B} 2.8
SHDocVw.WebBrowser w
sel message
,case WM_INITDIALOG
,w._getcontrol(id(3 hDlg))
,PowerPoint.Presentation pa=w.Document
,out pa.Name
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#9
stupomer Wrote:I'm sorry...I think I asked a question you already answered. I understand that only a browser can open many different t types of documents but is there a way to have a dialog for just ppt/pps?
S

Only if you can find an ActiveX control for it in Type Libraries dialog. I didn't find.
#10
Hi Gintaras,
Thanks for your help here. I am still having trouble with that popup dialog arising. What is werid is that I used to be able to look at Powerpoint's in Toolbar from menu that wrote to toolbar like this (where the locations were folders of powerpoint files):


Menu Sample Menu
Code:
Copy      Help
;/dontrun /expandfolders ;; make sure to set dontrun else will open a free-standing copy
>Category
,Cat1 "Z:\1" "SampleTb" *
,Cat2 "Z:\2" "SampleTb" *
,Cat3 "Z:\3" "SampleTb" *

Is there any reason, why a toolbar web browser would act differently than a dialog web browser?

Sorry if these questions are hard to answer without full examples.

Stuart
#11
What does this menu?
What is different in dialog and toolbar?


Forum Jump:


Users browsing this thread: 7 Guest(s)