Solved

Word Basic FileSaveAs ignores formatting

Posted on 1997-06-19
11
989 Views
Last Modified: 2006-11-17
I am using Word 6.0a for Windows under Windows 3.1

I have a macro which is trying to save a file in text format with line breaks.

I have included the statement:

FileSaveAs .Name = newfilename$, .Format = 3

but no matter how I try, the .Format clause is ignored, and the document is saved as a word document.

This happens whatever value I use in the clause.
0
Comment
Question by:za9ra50
11 Comments
 
LVL 1

Expert Comment

by:DarkAge
Comment Utility
Okay, Try this (us the full options statment):
FileSaveAs .Name = "Doc1.txt", .Format = 3, .LockAnnot = 0, .Password = "", .AddToMru = 1, .WritePassword = "", .RecommendReadOnly = 0, .EmbedFonts = 0, .NativePictureFormat = 0, .FormsData = 0, .SaveAsAOCELetter = 0
0
 

Author Comment

by:za9ra50
Comment Utility
Tried your suggestion, didn't seem to make any difference.

By the way,

.SaveAsAOCELetter = 0

isn't a valid component of the dialog, so I replaced it with the only element missing, .FormsData = 0

Full marks for speed of response though !
0
 
LVL 1

Expert Comment

by:DarkAge
Comment Utility
1) If this answer is not good for u u should reject it.
2) I have another option, just reject this one.
0
 

Expert Comment

by:DEREKCHASS
Comment Utility
It seems to work OK with Word6 under Win 95. Try this - and check the filename you give can be written to. (DiskSpace, read/write, permissions etc)

Sub MAIN
N$ = InputBox$("Name")
FileSaveAs .Name = N$, .Format = 2
End Sub

0
 

Author Comment

by:za9ra50
Comment Utility
Thank you for letting me know that it works under Windows 95.

File name, space and permissions are all OK, as the document is saved, with the specified name, but in Word document format.

Does anyone have any sugestions relevant to Windows 3.1 ?

Can anyone replicate the problem ?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:za9ra50
Comment Utility
Seems like a toughie.
0
 

Expert Comment

by:blovett
Comment Utility
Why are you trying to make a macro to save this file as a text documnt?  Why don't you just go do this:

File | Save As

and save the file as a MS-DOS Text with Line Breaks?
0
 

Author Comment

by:za9ra50
Comment Utility
I have a requirement to submit a monthly report of my team's work.

This is built up from last month's report plus input from various members of the team.

Word is an excellent tool to compose the report, but I wish to distribute it via Email. The Email client I use is Pegasus mail for windows, which is also an excellent (if somewhat basic) tool to do its job. However, it imports text most effectively when it has been saved as text with line breaks.

The macro does all sorts of processing, including moving last month's outlooks to this month's highlights, renaming the file, changing the title to refelct the reporting period, changing Word's bulleted lists to somthing that will look OK in Pegasus, and finally saving it in a format that Pegasus can import.

I could do it all manually (in fact I'm having to at the moment) but hey, ain't macros there to make life easier ?
0
 

Author Comment

by:za9ra50
Comment Utility
P.S. I would have rated your answer, but when I try, I get

File Not found

The requested URL /topics/bin/ChooseAnswer was not found on this server.
0
 
LVL 1

Accepted Solution

by:
DarkAge earned 200 total points
Comment Utility
Dear friend, I found the answer, it a BUG!!!
I have called: I have called to MS suport and ask the quastion, this is a bug and you have no way round it.
I know it a shame but live with it.
P.S: Took me 2 hours to reach head of support center in microsoft so i hope y'r rating will be good.
THanx.

0
 

Author Comment

by:za9ra50
Comment Utility
Not the answer I was hoping for, but anyone who can get to speak to anyone at Microsoft, never mind the Head of technical support, deserves a top rating.

It's nice to know I wasn't going mad....
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction It seems that at least a couple of times per month, I answer a question that requires automating Outlook from another Microsoft Office application, usually (although not always) to send one or more email messages.  For example: …
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now