Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 744
  • Last Modified:

Powerpoint VBA: Set default CommonDialog path to DESKTOP

I have a CommonDialog box in a PowerPoint application and was wondering if its possible to set the InitialDir to the DESKTOP instead of just the C Drive.  Is this possible?

Thanks!

Code:

Slide3172.CommonDialog1.CancelError = True
Slide3172.CommonDialog1.Filter = "PowerPoint Presentations (*.ppt)|*.ppt"
Slide3172.CommonDialog1.InitDir = "c:\"
Slide3172.CommonDialog1.ShowSave
DoEvents

If Slide3172.CommonDialog1.FileName <> "" Then
    ActivePresentation.SaveAs FileName:=Slide3172.CommonDialog1.FileName
    DoEvents
End If
0
kirkhilles
Asked:
kirkhilles
1 Solution
 
BelthazorCommented:
Hi,
try this:

CommonDialog1.InitDir = Environ("USERPROFILE") & "\Desktop"

move on
Belthazor
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now