Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Mark Dullingham Mark Dullingham is offline
external usenet poster
 
Posts: 9
Default Save as other formats in Word 2007

Office 2007

I have added the 'save as other formats' button to my quick access toolbar
but is it possible to change the default format for this button to a
different format than the normal save button ie PDF

I poduve a lot of docs in word but then nedd to save them in the same
directory as PDF's. Icurrently us 'Save As' then choose PDF.

If I can change the default format for just the 'save as other formats' it
will make things a bit simpler.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Save as other formats in Word 2007

Mark Dullingham wrote:
Office 2007

I have added the 'save as other formats' button to my quick access
toolbar but is it possible to change the default format for this
button to a different format than the normal save button ie PDF

I poduve a lot of docs in word but then nedd to save them in the same
directory as PDF's. Icurrently us 'Save As' then choose PDF.

If I can change the default format for just the 'save as other
formats' it will make things a bit simpler.

Thanks in advance


You can't change the behavior of the "Save as other formats" button. You
could write a macro that would display the Save As dialog with a different
file type. But if you want the PDF to have the same base filename with the
..pdf extension, you might as well just have the macro do the save without
showing the dialog.

Put this macro into your Normal.dotm template (see
http://www.gmayor.com/installing_macro.htm if needed):

Sub SaveAsPDF()
Dim fn As String
Dim fnpath As String

fn = ActiveDocument.Name
fnpath = WordBasic.FileNameInfo(fn, 5)
fn = fnpath & _
WordBasic.FileNameInfo(fn, 4) & ".pdf"

ActiveDocument.SaveAs _
FileName:=fn, _
FileFormat:=wdFormatPDF
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Mark Dullingham Mark Dullingham is offline
external usenet poster
 
Posts: 9
Default Save as other formats in Word 2007

Jay,

That works great except it always sves in 'My Documents' not in the folder
the original document was opened from .

My knowledge of VBA is limited and although I can see were the file path is
derived from I don't know how to modify it.

Also (this is a minor thing) is it posible toloose the '.docx' estionsion
from the pdf file name. Is this something to do with -

fn = fnpath & _
WordBasic.FileNameInfo(fn, 4) & ".pdf"

part of the code.

Many thanks in advance

"Jay Freedman" wrote:

Mark Dullingham wrote:
Office 2007

I have added the 'save as other formats' button to my quick access
toolbar but is it possible to change the default format for this
button to a different format than the normal save button ie PDF

I poduve a lot of docs in word but then nedd to save them in the same
directory as PDF's. Icurrently us 'Save As' then choose PDF.

If I can change the default format for just the 'save as other
formats' it will make things a bit simpler.

Thanks in advance


You can't change the behavior of the "Save as other formats" button. You
could write a macro that would display the Save As dialog with a different
file type. But if you want the PDF to have the same base filename with the
..pdf extension, you might as well just have the macro do the save without
showing the dialog.

Put this macro into your Normal.dotm template (see
http://www.gmayor.com/installing_macro.htm if needed):

Sub SaveAsPDF()
Dim fn As String
Dim fnpath As String

fn = ActiveDocument.Name
fnpath = WordBasic.FileNameInfo(fn, 5)
fn = fnpath & _
WordBasic.FileNameInfo(fn, 4) & ".pdf"

ActiveDocument.SaveAs _
FileName:=fn, _
FileFormat:=wdFormatPDF
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Save as other formats in Word 2007

Hi Mark,

I haven't been able to reproduce either of the situations you
described.

The WordBasic.FileNameInfo function is one of several functions that
were never fully converted from the old WordBasic language to VBA.
There's a description of it at
http://www.word.mvps.org/FAQs/Macros...icCommands.htm.

The numeric argument tells the function what part of the file name or
path to return. The 5 says to return the path without the filename,
and the 4 says to return the filename without the extension. In my
tests these behave as advertised, even with paths on Windows 7 and
with .docx extensions. As an example, if I open the document
C:\temp\greek\Greek.docx and run the macro, it creates
C:\temp\greek\Greek.pdf.

As a troubleshooting procedure, open the Locals window in the VBA
editor and run the macro one statement at a time by pressing F8. Watch
the values of fnpath and fn in the Locals as the macro executes. What
happens at each step?


On Fri, 14 Aug 2009 02:37:01 -0700, Mark Dullingham
wrote:

Jay,

That works great except it always sves in 'My Documents' not in the folder
the original document was opened from .

My knowledge of VBA is limited and although I can see were the file path is
derived from I don't know how to modify it.

Also (this is a minor thing) is it posible toloose the '.docx' estionsion
from the pdf file name. Is this something to do with -

fn = fnpath & _
WordBasic.FileNameInfo(fn, 4) & ".pdf"

part of the code.

Many thanks in advance

"Jay Freedman" wrote:

Mark Dullingham wrote:
Office 2007

I have added the 'save as other formats' button to my quick access
toolbar but is it possible to change the default format for this
button to a different format than the normal save button ie PDF

I poduve a lot of docs in word but then nedd to save them in the same
directory as PDF's. Icurrently us 'Save As' then choose PDF.

If I can change the default format for just the 'save as other
formats' it will make things a bit simpler.

Thanks in advance


You can't change the behavior of the "Save as other formats" button. You
could write a macro that would display the Save As dialog with a different
file type. But if you want the PDF to have the same base filename with the
..pdf extension, you might as well just have the macro do the save without
showing the dialog.

Put this macro into your Normal.dotm template (see
http://www.gmayor.com/installing_macro.htm if needed):

Sub SaveAsPDF()
Dim fn As String
Dim fnpath As String

fn = ActiveDocument.Name
fnpath = WordBasic.FileNameInfo(fn, 5)
fn = fnpath & _
WordBasic.FileNameInfo(fn, 4) & ".pdf"

ActiveDocument.SaveAs _
FileName:=fn, _
FileFormat:=wdFormatPDF
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2007: Manual document formats being auto added as a new style Neil C[_2_] Microsoft Word Help 6 June 5th 09 08:26 PM
Saving Word 2007 documents into other formats jeulaers Microsoft Word Help 1 November 29th 08 02:57 PM
Remove All Formats Word 2007 Pepper New Users 5 August 2nd 08 04:53 AM
File Save Formats Stuart Microsoft Word Help 7 July 26th 06 10:24 PM
combine word documents and save existing formats norherngrl Page Layout 1 June 14th 05 02:37 PM


All times are GMT +1. The time now is 07:51 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"