Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > file save as macro
 

file save as macro

Hi Experts

This is a excel question and not MSP..... i am also trying to do this in excel also

How would i amend the snippet code to make the macro work so that it automatically changes the file name parameter in the file save as window as shown in the screen print.....and save the copy to my doucments.

as shown in the screen print

i.e. the link between page and country?

each page number has been assigned a counbtry and this is fixed in stone and cannot change and the following page number corrspond to the following countries...

Page1 = Argentine
page2= Australia
page3= Austria
page4= Belgium
page5= Brazil
page6= Canada
page7= Chile
page8= China
page9= Colombia
page10= Czech Rep

i want the macro to run so that it inserts the following names into the file save as (box) next to filename(as shown in screen print document 2) countryname.pdf

and so on move through the above list of countries...

countryname = as shown above.
Vba code so far

Sub PrintToPDF()

FilePrint FromPage:=1, ToPage:=1, FromDate:="01/07/08 08:00", ToDate:="31/03/12 17:00"

SelectTaskField Row:=-4, Column:="Baseline Finish"

SelectTaskField Row:=-1, Column:="Name"

FilePrint FromPage:=2, ToPage:=2, FromDate:="01/07/08 08:00", ToDate:="31/03/12 17:00"

SelectTaskField Row:=-4, Column:="Baseline Finish"

SelectTaskField Row:=-1, Column:="Name"

End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Dim PDFFilePath As String

If SaveAsUI Then

PDFFilePath = CreateObject("WScript.Shell").Specialfolders("MyDocuments") & "\" & ThisProject.Name & ".pdf"

If Not FilePath = "False" Then

ThisProject.SaveAs FilePath

End If

Cancel = True

End If

End Sub
Pete727  Friday, October 17, 2008 9:55 AM

You have posted on the wrong forum.Come to this one. http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=74&SiteID=1

Myproduct  Monday, October 20, 2008 9:11 AM

This is a forum for deploying applications you have developed, not for questions on developing an application.

This appears to be an Excel programming question. The forum suggested by the other post is for VBA programming, which would also seem to apply.

If you are programming in Excel using VBA, try posting to the Excel Programming forum, which is here:

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.excel.programming&cat=en_US_6e1cf4bf-e0e7-4410-90ef-2c6ee77837e1&lang=en&cr=US

If it's really a Microsoft Projects developer question, try this discussion group:

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.project.developer&cat=en_US_ccc93814-89c8-441c-a48f-6e278361455a&lang=en&cr=US

RobinS.

GoldMail.com

RobinDotNet  Monday, October 20, 2008 9:05 PM

You have posted on the wrong forum.Come to this one. http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=74&SiteID=1

Myproduct  Monday, October 20, 2008 9:11 AM
This isa Microsoft Projects question.

Pete727  Monday, October 20, 2008 12:43 PM

This is a forum for deploying applications you have developed, not for questions on developing an application.

This appears to be an Excel programming question. The forum suggested by the other post is for VBA programming, which would also seem to apply.

If you are programming in Excel using VBA, try posting to the Excel Programming forum, which is here:

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.excel.programming&cat=en_US_6e1cf4bf-e0e7-4410-90ef-2c6ee77837e1&lang=en&cr=US

If it's really a Microsoft Projects developer question, try this discussion group:

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.project.developer&cat=en_US_ccc93814-89c8-441c-a48f-6e278361455a&lang=en&cr=US

RobinS.

GoldMail.com

RobinDotNet  Monday, October 20, 2008 9:05 PM

You can use google to search for other answers

Custom Search

More Threads

• Version number for .NET framework 3.5 launch condition
• :: Deployment app
• Bug in VS.NET 2005 for click-once deployment?
• Open ClickOnce-Application per Commandlineargs
• OFFICE PIA and ClickOnce
• Updating non-versioned files
• ClickOnce 3rd party certificate expired
• start clickonce (serverbased) application without focus on internet explorer
• System.Deployment.Application.DeploymentException (ManifestSemanticValidation)
• Where is smart client installed?