Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2018, 09:40 AM
hernans hernans is offline PDF default path Windows 7 64bit PDF default path Office 2007
Novice
PDF default path
 
Join Date: Jul 2018
Posts: 8
hernans is on a distinguished road
Default PDF default path

Hello,

Iīm looking for a macro to save the file as PDF in default folder.

I was able to save as pdf but not insert and work the default folder in the VBA.



Thanks
Reply With Quote
  #2  
Old 07-02-2018, 03:14 PM
macropod's Avatar
macropod macropod is offline PDF default path Windows 7 64bit PDF default path Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What is the code you're using?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-02-2018, 04:21 PM
hernans hernans is offline PDF default path Windows 7 64bit PDF default path Office 2007
Novice
PDF default path
 
Join Date: Jul 2018
Posts: 8
hernans is on a distinguished road
Default

Sub Save_to_PDF()
'
' Save_to_PDF Macro
'
'
With Dialogs(wdDialogFileSaveAs)
.Format = wdFormatPDF
.Show
End With
End Sub

I donīt know how to add a default path
Reply With Quote
  #4  
Old 07-02-2018, 04:47 PM
macropod's Avatar
macropod macropod is offline PDF default path Windows 7 64bit PDF default path Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You might try inserting:
.Name = Options.DefaultFilePath(wdDocumentsPath) & "\" & ActiveDocument.Name
before:
.Format = wdFormatPDF

In some Word versions, at least, wdDocumentsPath is unstable and returns whatever the current path is rather than the default path.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 07-02-2018, 05:02 PM
hernans hernans is offline PDF default path Windows 7 64bit PDF default path Office 2007
Novice
PDF default path
 
Join Date: Jul 2018
Posts: 8
hernans is on a distinguished road
Default

I want to setup the the defaul path
Reply With Quote
  #6  
Old 07-02-2018, 05:07 PM
macropod's Avatar
macropod macropod is offline PDF default path Windows 7 64bit PDF default path Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case replace:
Options.DefaultFilePath(wdDocumentsPath)
with whatever your ''default' path is. I'd have thought that was pretty obvious.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 07-02-2018, 05:19 PM
hernans hernans is offline PDF default path Windows 7 64bit PDF default path Office 2007
Novice
PDF default path
 
Join Date: Jul 2018
Posts: 8
hernans is on a distinguished road
Default

Sorry, maybe my english is not. Well, honestly is not good.

I recorded a video

https://www.screencast.com/t/Q3t7PhHv7

The problem is how to set a default folder to save the file.
Reply With Quote
  #8  
Old 07-02-2018, 06:02 PM
macropod's Avatar
macropod macropod is offline PDF default path Windows 7 64bit PDF default path Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you want to set a default save path, you could use:
Options.DefaultFilePath(wdDocumentsPath) = "C:\"
replacing "C:\" with whatever your preferred path is. You don't need the 'SaveAs' dialogue for that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 07-02-2018, 06:06 PM
hernans hernans is offline PDF default path Windows 7 64bit PDF default path Office 2007
Novice
PDF default path
 
Join Date: Jul 2018
Posts: 8
hernans is on a distinguished road
Thumbs up

It works. Thanks a lot.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF default path Turn OFF auto-adding file path as default alternative text for inserted objects Sergey SPb Drawing and Graphics 7 04-24-2017 11:25 PM
PDF default path Change old path to new path (batch) NobodysPerfect Word VBA 2 08-14-2014 10:09 PM
Publisher '07--default file path markg2 Publisher 0 02-15-2014 10:22 AM
Modify default template to include file path jacl Excel 1 03-26-2011 10:24 AM
How i can change default signature path? d4rqu Outlook 0 10-20-2009 02:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft