PC Review


Reply
Thread Tools Rate Thread

code to rename a file

 
 
EllaMentary
Guest
Posts: n/a
 
      13th Nov 2008
I'm working on creating a redacted (expunged) version of powerpoint
presentations for distribution outside our organization. I have a
macro to strip out notes and changing embedded charts to pics (so no-
one can see the data behind).

However, I need to add a prompts the user into File>Save As and
changes a filename and/or extension. For example.

test.ppt to r-test.ppt
or
test.pps to test.pps

This is to ensure the user doesn't accidently overwrite the original
file.

Any advice is greatly appreciated. I can post the finalized code if
anyone is interested.
 
Reply With Quote
 
 
 
 
John Wilson
Guest
Posts: n/a
 
      13th Nov 2008
Maybe include something like this:
Set opres = ActivePresentation
opres.SaveAs opres.Path & "\r-" & opres.Name
--

john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoi...tutorials.html




"EllaMentary" wrote:

> I'm working on creating a redacted (expunged) version of powerpoint
> presentations for distribution outside our organization. I have a
> macro to strip out notes and changing embedded charts to pics (so no-
> one can see the data behind).
>
> However, I need to add a prompts the user into File>Save As and
> changes a filename and/or extension. For example.
>
> test.ppt to r-test.ppt
> or
> test.pps to test.pps
>
> This is to ensure the user doesn't accidently overwrite the original
> file.
>
> Any advice is greatly appreciated. I can post the finalized code if
> anyone is interested.
>

 
Reply With Quote
 
EllaMentary
Guest
Posts: n/a
 
      14th Nov 2008
On Nov 13, 3:51*pm, Steve Rindsberg <ab...@localhost.com> wrote:
> In article <2a73cc57-f49a-49ec-9bc5-edaf3dddf...@q30g2000prq.googlegroups..com>,
>
> EllaMentary wrote:
> > I'm working on creating a redacted (expunged) version of powerpoint
> > presentations for distribution outside our organization. I have a
> > macro to strip out notes and changing embedded charts to pics (so no-
> > one can see the data behind).

>
> > However, I need to add a prompts the user into File>Save As and
> > changes a filename and/or extension. For example.

>
> > * * * test.ppt to r-test.ppt
> > * * * * * * or
> > * * * test.pps to test.pps

>
> > This is to ensure the user doesn't accidently overwrite the original
> > file.

>
> Do you really need to hand them a dialog box? *Could you just save the file
> back to the original folder then tell them what you've done?
>
> Dim sPath As String
> Dim sFileName As String
>
> With ActivePresentation
> * *sPath = .Path & "\"
> * *sFileName = "r-" & .Name
> * *.SaveAs FileName:=sPath & sFileName, fileformat:=ppSaveAsDefault
> End With
>
> MsgBox "Whacked, Smacked, Redacted and Saved to:" & vbcrlf _
> * * * *& sPath & sFileName
>
> -----------------------------------------
> Steve Rindsberg, PPT MVP
> PPT FAQ: *www.pptfaq.com
> PPTools: *www.pptools.com
> ================================================


Thank you Steve for your help. It worked beautifully.
 
Reply With Quote
 
EllaMentary
Guest
Posts: n/a
 
      14th Nov 2008
On Nov 13, 3:28*pm, John Wilson <john AT technologytrish.co DOT uk>
wrote:
> Maybe include something like this:
> Set opres = ActivePresentation
> opres.SaveAs opres.Path & "\r-" & opres.Name
> --
>
> john ATSIGN PPTAlchemy.co.uk
> Custom vba coding and PPT Makeovers
> Free PPT Hints, Tips and Tutorialshttp://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
>
>
>
> "EllaMentary" wrote:
> > I'm working on creating a redacted (expunged) version of powerpoint
> > presentations for distribution outside our organization. I have a
> > macro to strip out notes and changing embedded charts to pics (so no-
> > one can see the data behind).

>
> > However, I need to add a prompts the user into File>Save As and
> > changes a filename and/or extension. For example.

>
> > * * * test.ppt to r-test.ppt
> > * * * * * * or
> > * * * test.pps to test.pps

>
> > This is to ensure the user doesn't accidently overwrite the original
> > file.

>
> > Any advice is greatly appreciated. I can post the finalized code if
> > anyone is interested.- Hide quoted text -

>
> - Show quoted text -


Thanks John. The code worked. The minor caveat was when I closed the
file and tried to rerun it it gave me an error message that the file
was open (even if I deleted it).
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename errorin Vista - multiple file rename James136 Windows Vista File Management 3 4th Apr 2008 10:01 AM
Code to add a workbook the rename it L. Howard Kittle Microsoft Excel Programming 3 22nd Feb 2008 05:57 PM
Rename caption using code =?Utf-8?B?bSBzdHJvdXA=?= Microsoft Access VBA Modules 2 23rd Oct 2007 05:26 PM
Code linked to a form to copy and rename a file Paddy Microsoft Access VBA Modules 3 16th May 2006 07:09 PM
Is there a way in code to rename a file John Microsoft Access Form Coding 1 2nd May 2004 07:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:20 AM.