Solved

Powerpoint VBA: Set default CommonDialog path to DESKTOP

Posted on 2004-08-17
2
722 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
cumlative total for mileage in excel 35 32
excel forecast function 1 29
Macbook MS Office installer missing 11 55
Oart.dll 2 28
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
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.

762 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