doc save _ vba

save a word doc using a vba.

the doc saved should not contain my code

the doc should be save in a new/desired folder

every time i run the code it should save a new version
Vivek SethiaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vivek SethiaAuthor Commented:
still waiting
0
MacroShadowCommented:
What have you tried?
0
Vivek SethiaAuthor Commented:
ActiveDocument.SaveAs2 FileName:="vivek"

The problem is that it is saving the file along with the code. Hence i would want the doc to be saved in the desired folder and only a word doc.
0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

MacroShadowCommented:
Please try:
application.displayalerts=false
ActiveDocument.SaveAs2 FileName:="vivek", FileFormat:=wdFormatXMLDocument
application.displayalerts=true

Open in new window

0
Vivek SethiaAuthor Commented:
- Should also define a path, inorder to save the doc in the desired folder

- The Fileformat should be docx right?
0
MacroShadowCommented:
Instead of vivek put the full file name including the path.
wdFormatXMLDocument will give you a docx without the code.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vivek SethiaAuthor Commented:
hi,

I am not able to unbold my lines

Current Use

'start new line after table'

myRange.EndOf wdStory, wdMove
myRange.InsertAfter "   " & vbCr
myRange.InsertAfter "General Terms And conditions" & vbCr
myRange.InsertAfter "   " & vbCr

'removing bold font
Selection.TypeText Text:="General Terms And conditions"
Selection.Font.Bold = False
0
Vivek SethiaAuthor Commented:
please help
0
Vivek SethiaAuthor Commented:
Some Error

Code Used:

Dim filename As String
Application.DisplayAlerts = False
ActiveDocument.SaveAs2 filename:="C:\Users\Vivek\Documents\saving workbook\" & TBox10.Value & ".docx", Fileformat:=wdFormatXMLDocument
Application.DisplayAlerts = True
0
MacroShadowCommented:
What is the error?

try
Application.DisplayAlerts = False
ActiveDocument.SaveAs2 FileName:="C:\Users\Vivek\Documents\saving workbook\" & TBox10.Value & ".docx", Fileformat:=wdFormatXMLDocument
Application.DisplayAlerts = True 

Open in new window

0
Vivek SethiaAuthor Commented:
Error is :

this is not a valid file name
0
Vivek SethiaAuthor Commented:
Problem solved.

The Filename was Savingworkbook and Not Saving Workbook
0
MacroShadowCommented:
The original question was not solved by you!
You made a mistake which you corrected, but it has nothing to do with the solution which I gave in answers:
ID: 42455135
ID: 42457080
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.