Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-24-2015, 03:33 AM
McHjertholm McHjertholm is offline Save as both pdf and docx Mac OS X Save as both pdf and docx Office for Mac 2011
Novice
Save as both pdf and docx
 
Join Date: Feb 2015
Posts: 10
McHjertholm is on a distinguished road
Exclamation Save as both pdf and docx

Hello
I am posting this here as well, as it most likely is VBA-related.

I need a way to save the document as both pdf and docx. And also update the pdf when changes has been saved in the doc, instead of making another pdf file. I would prefer to have the two documents in the same location, and to avoid the "do you want to replace"-message, because of the pdf.



I would appreciate a solution to this very much!
Reply With Quote
  #2  
Old 02-25-2015, 02:54 AM
gmayor's Avatar
gmayor gmayor is offline Save as both pdf and docx Windows 7 64bit Save as both pdf and docx Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,105
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

There will be no warning if you save with VBA (at least not in a PC environment). I am not sure if this will translate to the Mac.

Code:
Sub SaveAsDocXandPDF()
Dim strPath As String
    On Error GoTo err_Handler
    ActiveDocument.Save
    strPath = Left(ActiveDocument.FullName, InStrRev(ActiveDocument.FullName, ".") - 1) & ".pdf"
    ActiveDocument.SaveAs2 Filename:=strPath, FileFormat:=wdFormatPDF, AddToRecentFiles:=False
lbl_Exit:
    Exit Sub
err_Handler:
    MsgBox "Document not saved"
    Resume lbl_Exit
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 02-25-2015, 12:52 PM
McHjertholm McHjertholm is offline Save as both pdf and docx Mac OS X Save as both pdf and docx Office for Mac 2011
Novice
Save as both pdf and docx
 
Join Date: Feb 2015
Posts: 10
McHjertholm is on a distinguished road
Default

Thanks for the response. What happened when I ran it was that i had to choose location, and then it showed the error message you put in without making a pdf file.
Reply With Quote
  #4  
Old 02-25-2015, 10:59 PM
gmayor's Avatar
gmayor gmayor is offline Save as both pdf and docx Windows 7 64bit Save as both pdf and docx Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,105
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The call to SaveAs2 must not work in the Mac version Change that to SaveAs and see if that works for you.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 02-26-2015, 12:40 AM
McHjertholm McHjertholm is offline Save as both pdf and docx Mac OS X Save as both pdf and docx Office for Mac 2011
Novice
Save as both pdf and docx
 
Join Date: Feb 2015
Posts: 10
McHjertholm is on a distinguished road
Default

Thank you very much, that solved it It still gives the error message even though it actually saves both files, so I just removed it
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Save as both pdf and docx Save as both pdf and docx McHjertholm Word 2 02-24-2015 01:11 PM
Save HTML as DOCX john1 Word 1 11-21-2014 10:56 PM
Save as both pdf and docx After Word crash, can no longer save as .docx mrwednesday Word 4 10-15-2013 01:21 AM
Save as both pdf and docx How can I set *.doc as default save format and NOT *.docx? pstein Word 1 01-11-2012 09:30 AM
Save as both pdf and docx Can't Save a file as .docx the_lil Word 5 10-27-2011 08:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:24 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