?
Solved

Powerpoint VBA: Set default CommonDialog path to DESKTOP

Posted on 2004-08-17
2
Medium Priority
?
733 Views
Last Modified: 2008-01-09
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
Comment
Question by:kirkhilles
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
Belthazor earned 1000 total points
ID: 11828238
Hi,
try this:

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

move on
Belthazor
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question