Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2013, 08:06 PM
drod drod is offline How to use the SaveAsDialog after UserForm is closed Windows 7 64bit How to use the SaveAsDialog after UserForm is closed Office 2010 64bit
Novice
How to use the SaveAsDialog after UserForm is closed
 
Join Date: Mar 2013
Posts: 1
drod is on a distinguished road
Default How to use the SaveAsDialog after UserForm is closed

I have a word template with an Userform that an user must fill and then click on OK to copy all the data in the fields from the userform into bookmarks... that part is working...

My issue is... once all the data in transferred with the click function for the OK button I have the unload me command to close the user form...

then in the userform_terminate function I have the Following:

Private Sub UserForm_Terminate()

Dim strFileName As String
Dim StrPath As String
provide default filename
StrPath = "c:\temp\test.docx"
With Dialogs(wdDialogFileSaveAs)
.Name = StrPath
If .Display <> 0 Then
strFileName = .Name
Else
' strFileName = "User Cancelled"
End If
End With
MsgBox strFileName

End Sub

What I am trying to do is that after I click on OK and all the data is copied in the bookmarks. Then I want the save as dialog to pop up with a predetermined name from the textboxes in the userform...



The issue is.. after I click on Ok and the userform is closed.. the Popup Save As dialog appears... I save it... then the data is copied to the bookmarks in the word document... however #1 the document does not get saved and the title of the work document does not change either.. is like the save as dialog did not execute even though it looks like it does...

Any help will be appreciated.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 prompting to save attachments when they have been closed for hours Bamlaw Outlook 0 09-06-2012 03:13 PM
Question on userform and doc interaction icecode Word 3 08-01-2012 08:41 AM
Please help ...... Outlook 2010 closes when VCard is closed virajithasarma Outlook 0 09-21-2011 02:09 AM
How to use the SaveAsDialog after UserForm is closed open a doc where I closed it Taras49 Word 1 01-30-2011 02:12 PM
Outlook userform validation help aiwnjoo Outlook 0 12-08-2010 12:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:30 AM.


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