Solved

Word Basic FileSaveAs ignores formatting

Posted on 1997-06-19
11
1,020 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

Learn how to provision tenants, synchronize on-premise Active Directory, and implement Single Sign-On with these master level course.  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 200 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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: …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

732 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