Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2015, 07:12 AM
brmveen brmveen is offline save dialog box promt doesn't save file Windows 7 64bit save dialog box promt doesn't save file Office 2013
Novice
save dialog box promt doesn't save file
 
Join Date: Nov 2015
Posts: 2
brmveen is on a distinguished road
Default save dialog box promt doesn't save file

For some reason the file doesn't get saved.



HTML Code:
Function saveFile()

    Dim strFileName As String
    Dim StrPath As String
    Dim instance As WdSaveFormat
    Dim format As String
    
    'provide a file type
    format = wdFormatXMLDocumentMacroEnabled
    
    'provide default filename
    saveName = "test124.docm"
    
    'provide a path
    pathFull = "C:\temp\"
                   
    'concat path
    StrPath = pathFull & saveName
       
    With Dialogs(wdDialogFileSaveAs)
        .Name = StrPath
        .format = format
        If .Display <> 0 Then
            MsgBox ("thanks")
        Else
            strFileName = "User Cancelled"
        End If
    End With
End Function

Sub Test()
    Call saveFile
End Sub
Reply With Quote
  #2  
Old 11-03-2015, 02:55 PM
macropod's Avatar
macropod macropod is offline save dialog box promt doesn't save file Windows 7 64bit save dialog box promt doesn't save file Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,726
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try changing .Display to .Show. You might also use the variables you've defined instead of defining them then using undefined variable names instead...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-04-2015, 12:51 AM
brmveen brmveen is offline save dialog box promt doesn't save file Windows 7 64bit save dialog box promt doesn't save file Office 2013
Novice
save dialog box promt doesn't save file
 
Join Date: Nov 2015
Posts: 2
brmveen is on a distinguished road
Default

Changing to .show actually works. I'm a bit surprised because I didn't think to look in that part of code because that partially worked. Changing the format to pdf en keeping .display worked.

Thanks a million!

did some research:

the difference makes a bit more sence now:
.display only display the menu, sort of a view only thing (can even be timed)
.show shows and executes the menu.

https://msdn.microsoft.com/en-us/lib.../dn320601.aspx
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
save dialog box promt doesn't save file How to deactivate File Save dialog box KIM SOLIS Word 3 12-15-2013 12:30 PM
Save as and Open dialog boxes blank stuartmush Word 1 09-20-2013 03:04 PM
save dialog box promt doesn't save file When I try to save an existing word doc, save as pops up and will not save... samanthab Word 3 01-19-2013 06:27 AM
Can Save As dialog be suppressed? dug_down_deep PowerPoint 0 10-05-2010 09:46 AM
Promt for save location when sendimg mail blegs38552 Outlook 0 01-31-2010 07:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2022 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft