Solved

Powerpoint VBA: Set default CommonDialog path to DESKTOP

Posted on 2004-08-17
2
724 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
2 Comments
 
LVL 3

Accepted Solution

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

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

move on
Belthazor
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

912 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now