Hi guys, topic title says all. 2 days frustrating work for a simple problem.
Is here an expert, who could help me.
Please PM me.
You're currently viewing posts by Pinsider german-pinball.
Click here to go back to viewing the entire thread.
Hi guys, topic title says all. 2 days frustrating work for a simple problem.
Is here an expert, who could help me.
Please PM me.
Quoted from KozMckPinball:What's the question?
I never programmed with VBA for word, means, I absolutely have no idea. Everything is completely new to me.
I want to make a special SaveAs Funktion.
I have 2 Makros:
FIRST MAKRO:
Sub SaveAs ()
Dim dialog As Object
Dim pfad As String
Dim datei As String
path = "C:\Test\"
Set dialog = Application.FileDialog(msoFileDialogSaveAs)
With dialog
.InitialFileName = path
.Show
End With
If dialog <> False Then dialog.Execute
End Sub
This makro works and gives me the desired path C:\Test at once.
SECOND MAKRO:
I now want to type in the file name in a message box and then it should not directly store in C:\Test, I want to see the same window as in MAKRO 1, so I can select in c:\Test another folder.
Hope, I have explained it correctly, but I am absolutely now computer freak
Here is the second one:
Sub SaveAs_Special ()
'
' Macro SaveAs Special'
'
Dim FileName As String
'
FileName = InputBox("Please Enter File Name" & vbNewLine & "Use following Format:",
Space(3) & "Speichern unter ...")
'
Select Case StrPtr(FileName)
Case Is = 0
MsgBox "You 'klicked' Exit." & vbNewLine & "Example Text!!!"
'ActiveDocument.Close
Exit Sub
Case Else
ActiveDocument.SaveAs FileName:="C:\Test\"
& Format(Date, "dd mm yyyy") & " – Letter to " & Filename & ".doc"
Exit Sub
End Select
End Sub
You're currently viewing posts by Pinsider german-pinball.
Click here to go back to viewing the entire thread.
Wanna join the discussion? Please sign in to reply to this topic.
Great to see you're enjoying Pinside! Did you know Pinside is able to run without any 3rd-party banners or ads, thanks to the support from our visitors? Please consider a donation to Pinside and get anext to your username to show for it! Or better yet, subscribe to Pinside+!
This page was printed from https://pinside.com/pinball/forum/topic/looking-for-an-expert-for-vba-for-word-2013?tu=german-pinball and we tried optimising it for printing. Some page elements may have been deliberately hidden.
Scan the QR code on the left to jump to the URL this document was printed from.