?
Solved

Word Basic FileSaveAs ignores formatting

Posted on 1997-06-19
11
Medium Priority
?
1,036 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 1

Expert Comment

by:DarkAge
ID: 1602891
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
ID: 1602892
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
ID: 1602893
1) If this answer is not good for u u should reject it.
2) I have another option, just reject this one.
0
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 

Expert Comment

by:DEREKCHASS
ID: 1602894
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
ID: 1602895
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
 

Author Comment

by:za9ra50
ID: 1602896
Seems like a toughie.
0
 

Expert Comment

by:blovett
ID: 1602897
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
ID: 1602898
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
ID: 1602899
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 800 total points
ID: 1602900
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
ID: 1602901
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

764 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