forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Spreadsheet Shell for OWC11

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code
View previous topic :: View next topic  
Author Message
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 686
Location: Evansville, IN

PostPosted: Mon Apr 18, 2011 7:07 am    Post subject: Spreadsheet Shell for OWC11 Reply with quote

relies on VDSDOM50.DSU at http://www.vdsworld.com/forum/viewtopic.php?p=36186

Code:
gosub initialize
 
  external vdsbrw50.dll
 #include vdsdom50.dsu
#define command,browser
#define function,browser
title Simple Spreadsheet
  DIALOG CREATE,Simple Spreadsheet,-1,0,800,600,RESIZABLE,savepos
REM *** Modified by Dialog Designer on 4/10/2011 - 22:48 ***
  DIALOG ADD,browser,Browser1,0,0,100,200,""
  dialog add,browser,browser2,0,0,0,0,""
 dialog add,menu,&File,&New,&Open,&Save,&Save As,&Publish
 rem dialog add,button,button1,0,0,100,200,test
 
 option errortrap,runas
registry write,root,.owx,,"Office.WebSpreadsheet"
registry write,root,Office.WebSpreadsheet\shell\Open\command,,@chr(34)%0@chr(34) @chr(34)@chr(37)1@chr(34)
    option errortrap,""
   
     if %1
  if @equal(%1,runasadmin)
   if %2
   dialog set,browser1,%2
   else
   dialog set,browser1,@text(1)
   end
   
   else
  dialog set,browser1,%1
  end
  else
  dialog set,browser1,@text(1)
  end
 
  DIALOG SHOW
rem info @regread(root,.owx\shell\Open\command)
goto resize

 
   :evloop
     if %%file
  dialog title,@name(%%file) - Simple Spreadsheet
  else
  dialog title,Simple Spreadsheet
  end
    wait event
    %%event = @event()
  goto %%event
 
   :save asmenu
  dialog set,browser1,@getlargeattribute(browser1,tag,html,outerHTML,0)
  %%filedlg = @filedlg("HTML Spreadsheet (OWX)"|*.owx,Save "Spreadsheet",,save)
  if %%filedlg
  if @null(@ext(%%filedlg))
  %%filedlg = %%filedlg.owx
  end
  browser savefile,browser1,%%filedlg
  %%file = %%filedlg
  else
rem  info Save aborted.
  end
  goto evloop
 
  :savemenu
  if %%file
  rem do nothing
  else
  goto save asmenu
  end
    dialog set,browser1,@getlargeattribute(browser1,tag,html,outerHTML,0)
       browser savefile,browser1,%%file
      goto evloop
     
  :openmenu
  %%file = @filedlg("HTML Spreadsheet (OWX)"|*.owx,"Open Spreadsheet")
  if %%file
  dialog set,browser1,%%file
  rem setattribute browser1,tag,body,contentEditable,True,0
  end
  goto resize
 
  :newmenu
  %%ask = @ask(Save Spreadsheet?)
  if %%ask
  goto save asmenu
  end
  %%file = ""
  dialog set,browser1,@text(1)
    goto resize
 
  :close
  exit
 
  :resize
  dialog setpos,browser1,0,0,@dlgpos(,w),@diff(@dlgpos(,h),20)
rem  window position,@window(@getbrowserid2(),CHILD),0,0,@dlgpos(,w),@diff(@dlgpos(,h),20)
  setattribute browser1,id,Book1_17125_Spreadsheet,height,@diff(@dlgpos(,h),25)
  setattribute browser1,id,Book1_17125_Spreadsheet,width,@diff(@dlgpos(,w),5)
  goto evloop


     :runas
     if %1
     shell runas,@chr(34)%1@chr(34),runasadmin
     else
     shell runas,@chr(34)%0@chr(34),runasadmin,@chr(34)@Path(%0)@chr(34)
     end
     stop
     
     :publishmenu
    rem Content-Type: text/html
   rem Content-Transfer-Encoding: 8bit
 %%xl = @getlargeattribute(browser1,tag,html,outerHTML,0)
 dialog set,browser1,<!--@cr()Content-Type: text/html@cr()Content-Transfer-Encoding: 8bit@cr()@cr()%%xl
  %%filedlg = @filedlg("Web Archive (MHT)"|*.mht,Save "Spreadsheet",,save)
  if %%filedlg
  if @null(@ext(%%filedlg))
  %%filedlg = %%filedlg.mht
  end
  browser savefile,browser1,%%filedlg
  %%file = %%filedlg
  else
rem  info Save aborted.
  end
  goto evloop

 
  :initialize
   list create,1
 list loadtext,1
"<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o = "urn:schemas-microsoft-com:office:office" xmlns:x = "urn:schemas-microsoft-com:office:excel"><HEAD>
"<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
"<META name=ProgId content=FrontPage.Editor.Document>
"<META name=Generator content="Microsoft Excel 11"><LINK rel=File-List href="Book1_files/filelist.xml"></HEAD>
"<BODY style="overflow:'hidden'" contentEditable=false style="margin-top:0;margin-left:0;margin-bottom:0;margin-right:0">
"<DIV id=Book1_17125 align=center x:publishsource="Excel" height=100% width=100% style="margin-top:0;margin-left:0;margin-bottom:0;margin-right:0">
"<OBJECT style="margin-top:0;margin-left:0;margin-bottom:0;margin-right:0" id=Book1_17125_Spreadsheet classid=CLSID:0002E559-0000-0000-C000-000000000046 width=100% height=100%>
"<PARAM NAME="AllowPropertyToolbox" VALUE="1">
"<PARAM NAME="AutoFit" VALUE="0">
"<PARAM NAME="Calculation" VALUE="-4105">
"<PARAM NAME="Caption" VALUE="Freedom Spreadsheet">
"<PARAM NAME="DisplayColumnHeadings" VALUE="-1">
"<PARAM NAME="DisplayGridlines" VALUE="-1">
"<PARAM NAME="DisplayHorizontalScrollBar" VALUE="-1">
"<PARAM NAME="DisplayOfficeLogo" VALUE="0">
"<PARAM NAME="DisplayWorkbookTabs" VALUE="0">
"<PARAM NAME="DisplayPropertyToolbox" VALUE="-1">
"<PARAM NAME="DisplayRowHeadings" VALUE="-1">
"<PARAM NAME="DisplayTitleBar" VALUE="0">
"<PARAM NAME="DisplayToolbar" VALUE="0">
"<PARAM NAME="DisplayVerticalScrollBar" VALUE="-1">
"<PARAM NAME="MaxHeight" VALUE="100%">
"<PARAM NAME="MaxWidth" VALUE="100%">
"<PARAM NAME="DisplayWorkbookTabs" VALUE="-1">
"<PARAM NAME="EnableEvents" VALUE="-1">
"<PARAM NAME="MoveAfterReturn" VALUE="-1">
"<PARAM NAME="MoveAfterReturnDirection" VALUE="-4121">
"<PARAM NAME="RightToLeft" VALUE="0">
"<PARAM NAME="ScreenUpdating" VALUE="-1">
"<PARAM NAME="LockedDown" VALUE="0">
"<PARAM NAME="ConnectedToChart" VALUE="0">
"<PARAM NAME="DefaultQueryOnLoad" VALUE="-1">
"<PARAM NAME="EnableUndo" VALUE="-1">
"<PARAM NAME="DataType" VALUE="XMLDATA">
"<PARAM NAME="XMLData" VALUE='<?xml version="1.0"?> <ss:Workbook xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet"> <x:ExcelWorkbook>  
"<x:ProtectStructure>False</x:ProtectStructure>   <x:ActiveSheet>0</x:ActiveSheet> </x:ExcelWorkbook>
"<ss:Styles>   <ss:Style ss:ID="Default">    <ss:Alignment ss:Horizontal="Automatic" ss:Rotate="0.0"
"ss:Vertical="Bottom"     ss:ReadingOrder="Context"/>    <ss:Borders>    </ss:Borders>    
"<ss:Font ss:FontName="Arial" ss:Size="10" ss:Color="Automatic" ss:Bold="0"     ss:Italic="0"
"ss:Underline="None"/>    <ss:Interior ss:Color="Automatic" ss:Pattern="None"/>    <ss:NumberFormat
"ss:Format="General"/>    <ss:Protection ss:Protected="1"/>   </ss:Style> </ss:Styles>
"<c:ComponentOptions>   <c:Label>    <c:Caption>Microsoft Office Spreadsheet</c:Caption>  
"</c:Label>   <c:SpreadsheetAutoFit/>   <c:MaxHeight>80%</c:MaxHeight>  
"<c:MaxWidth>80%</c:MaxWidth>   <c:NextSheetNumber>4</c:NextSheetNumber> </c:ComponentOptions>
"<x:WorkbookOptions>   <c:OWCVersion>11.0.0.5531         </c:OWCVersion> </x:WorkbookOptions>
"<ss:Worksheet ss:Name="Sheet1">   <x:WorksheetOptions>    <x:Selected/>    
"<x:ViewableRange>R1:R262144</x:ViewableRange>    <x:Selection>R1C1</x:Selection>    
"<x:TopRowVisible>0</x:TopRowVisible>    <x:LeftColumnVisible>0</x:LeftColumnVisible>    
"<x:ProtectContents>False</x:ProtectContents>   </x:WorksheetOptions>   <c:WorksheetOptions>  
"</c:WorksheetOptions> </ss:Worksheet> <ss:Worksheet ss:Name="Sheet2">  
"<x:WorksheetOptions>    <x:ViewableRange>R1:R262144</x:ViewableRange>    
"<x:Selection>R1C1</x:Selection>    <x:TopRowVisible>0</x:TopRowVisible>    
"<x:LeftColumnVisible>0</x:LeftColumnVisible>    <x:ProtectContents>False</x:ProtectContents>  
"</x:WorksheetOptions>   <c:WorksheetOptions>   </c:WorksheetOptions> </ss:Worksheet>
"<ss:Worksheet ss:Name="Sheet3">   <x:WorksheetOptions>    
"<x:ViewableRange>R1:R262144</x:ViewableRange>    <x:Selection>R1C1</x:Selection>    
"<x:TopRowVisible>0</x:TopRowVisible>    <x:LeftColumnVisible>0</x:LeftColumnVisible>    
"<x:ProtectContents>False</x:ProtectContents>   </x:WorksheetOptions>   <c:WorksheetOptions>  
"</c:WorksheetOptions> </ss:Worksheet> </ss:Workbook> '>
"   <p style='margin-top:100;font-family:Arial;font-size:8.0pt'>To use this Web
" page interactively, you must have Microsoft® Internet Explorer 5.01 Service
" Pack 2 (SP2) or later and the Microsoft Office 2003 Web Components.</p>
" <p style='margin-top:100;font-family:Arial;font-size:8.0pt'>See the <a
" href="http://r.office.microsoft.com/r/rlidmsowcpub?clid=1033&amp;p1=Excel">Microsoft
" Office Web site</a> for more information.</p></OBJECT></DIV></BODY></HTML>
exit
Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 686
Location: Evansville, IN

PostPosted: Tue Apr 19, 2011 1:01 am    Post subject: Reply with quote

Interesting stuff can be integrated into this sort of solution....


http://www.rgagnon.com/jsdetails/js-0122.html


Note also that column and row headings can be hidden, and it doesn't have to start with a toolbar or even have the toolbar accessible.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group