Solved

Word Basic FileSaveAs ignores formatting

Posted on 1997-06-19
11
1,022 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

717 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