Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    vb prompt user to save file as when export owc chart to gif

    I have a method which works perfectly fine to export office web charts to gif and save them on the c drive or a drive which i allow the user to specify.

    i am NOW being told that this isn't good enough and i need a 'save as' dialog box to pop up to browse through the users directory so they can choose teh location..

    Can't find any information on this on the net. Any ideas?

    Badly stuck
    Saz
    ***
    <code>
    This method i have so far is as follows:
    Sub export()
    On Error Resume Next

    answer = MsgBox("Would you like the image saved on your C drive? "&vbcrlf&"Click ""No"" to specify location",3)

    If not Err then

    if( answer = 7) then
    typed_location = InputBox("Enter location of file e.g. H:/ Default is C:/ ")
    if(typed_location <> "") then
    picturename = typed_location & "faultPrsChart"&Day(Date)&"_"&Month(Date)&"_"&Year(date)&".gif"
    ChartSpace1.ExportPicture picturename, "gif", 600, 350
    if Err = 0 then
    window.open(picturename)
    end if
    end if
    elseif answer = 6 then
    picturename = "C:\faultPrsChart"&Day(Date)&"_"&Month(Date)&"_"&Year(date)&".gif"
    'alert( Err )
    ChartSpace1.ExportPicture picturename, "gif", 600, 350
    if Err = 0 then
    window.open(picturename)
    end if
    end if
    end if
    End Sub
    </code>

  • #2
    New Coder
    Join Date
    Aug 2004
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This may help (common theme among them is "MSComDlg.CommonDialog"...search Google for more/better info)

    http://support.microsoft.com/default...b;EN-US;325630

    http://www.mvps.org/access/api/api0001.htm

    http://www.experts-exchange.com/Data..._20668770.html

    http://cwashington.netreach.net/depo...tType=vbscript

    VBScript from the above link:
    Code:
    '********************
    ' Shows a MS common dialog. Used to choose a filename.
    ' Arguments:
    ' ttl the title of the dialog.
    ' fltr the filter string.
    ' initDir the initial directory in which to open from/save to.
    ' dlgtype the type of dialog to show. Only open and save are allowed.
    ' Returns the fully qualified path and file name.
    '********************
    function CommonDialog(byval ttl, byval fltr, byval initDir, byval dlgtype)
        CommonDialog = ""
        dim errMsg
        with dlg
            .cancelerror = false
            .dialogtitle = ttl
            .filter = fltr
            .filterindex = 2
            .initdir = initDir
            .maxfilesize = 260
            select case lcase(dlgtype)
                case "open"
                    .showopen
                case "save"
                    .showsave
                case else
                    errMsg = replace(getResource("dlgerror"), "`dlgtype`",dlgtype)
                    ' ShowMsg in vbscript_shell.vbs
                    ShowMsg errMsg, vbcritical + vbokonly
                    wscript.quit 1
            end select
            CommonDialog = .filename
        end with
    end function


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •