Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-10-2014, 05:25 AM
Madbags Madbags is offline Set File Type when clicking Save As Windows 7 64bit Set File Type when clicking Save As Office 2013
Novice
Set File Type when clicking Save As
 
Join Date: Oct 2014
Posts: 1
Madbags is on a distinguished road
Default Set File Type when clicking Save As

Hi,

I'm encountering an issue with my Macro.

I have got it to work thus far to remove the Read Only status and clear the password boxes when someone opens the document using AutoOpen so when someone clicks "Save As" they do not then need to remove the read only status.

Code:
 
Public Sub AutoOpen()
With Dialogs(wdDialogFileSaveAs)
ActiveDocument.ReadOnlyRecommended = False
ActiveDocument.Password = ""
ActiveDocument.WritePassword = ""
End With
End Sub
Now this code words fine but what I don't want is people then saving this as a Macro Enabled Word Document after by accident so I would like either when "Save As" is clicked or when the document opened for it to automatically choose .Docx / Word Document. I don't need the filename ot change or anything just this.

Now I tried adding

Code:
ActiveDocument.SaveAs2 FileFormat:=wdFormatXMLDocument
and it seems to run the code and change it but when I save it and close Word the document can no longer be opened, with no specified error.



Can anyone help, or maybe produce something better, that works?

Thanks
Reply With Quote
  #2  
Old 10-10-2014, 01:07 PM
macropod's Avatar
macropod macropod is offline Set File Type when clicking Save As Windows 7 64bit Set File Type when clicking Save As 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

Why is your code in the document, rather than in its template? If the code were in the template, the documents could already be the docx type and there'd be no need to worry about them having to change to that save format.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
"No program is registered to open this file" when clicking hyperlink EatVegetables Excel 2 12-23-2014 09:23 AM
Set File Type when clicking Save As Prompt a macro to run when opening a specific file type gmanword Word VBA 5 11-30-2013 02:55 PM
Set File Type when clicking Save As Word file type in 2007 casaserves Word 4 08-03-2013 01:11 AM
Getting COMException Incompatible file type and file extension sbalerao Mail Merge 0 04-21-2011 10:30 AM
Open a linked file without mouse clicking it Vangskop PowerPoint 0 03-09-2011 10:08 AM

Other Forums: Access Forums

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