|
|
|
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов?
|
|||
|---|---|---|---|
|
#18+
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.02.2012, 20:10 |
|
||
|
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов?
|
|||
|---|---|---|---|
|
#18+
Заменить шрифт на моноширинный. Убрать выравнивание по ширине. Вставкой пробелов выровнять абзацы по ширине. Сохранить как *.txt, разрешив разрывы строк и подстановку знаков. Вообще, поискать специализированные надстройки, которые умеют это делать... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.02.2012, 20:42 |
|
||
|
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов?
|
|||
|---|---|---|---|
|
#18+
Большое спасибо, как в коде это будет выглядеть? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.02.2012, 11:27 |
|
||
|
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов?
|
|||
|---|---|---|---|
|
#18+
GrafBerkutБольшое спасибо, как в коде это будет выглядеть?в коде это будет выглядеть длинно, нудно и небесплатно. Поэтому зачем писать то, что уже неоднократно написано другими - просто найдите. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.02.2012, 11:59 |
|
||
|
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов?
|
|||
|---|---|---|---|
|
#18+
Кто подскажет описание функций для работы с MS WORD через переменные Variant? По сути мне нужно значение одного параметра, при сохранении в .txt? который отвечает за расстановку переносов. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.02.2012, 14:28 |
|
||
|
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов?
|
|||
|---|---|---|---|
|
#18+
GrafBerkutКто подскажет описание функций для работы с MS WORD через переменные Variant? По сути мне нужно значение одного параметра, при сохранении в .txt? который отвечает за расстановку переносов. это типа вопрос про "автоматизацию Ворда" ? ну так "кто подскажет ?" - хелп, конечно F1 SaveAs Method Saves the specified document with a new name or format. Some of the arguments for this method correspond to the options in the Save As dialog box (File menu). expression.SaveAs(FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter, Encoding, InsertLineBreaks, AllowSubstitutions, LineEnding, AddBiDiMarks) expression Required. An expression that returns a Document object. FileName Optional Variant. The name for the document. The default is the current folder and file name. If the document has never been saved, the default name is used (for example, Doc1.doc). If a document with the specified file name already exists, the document is overwritten without the user being prompted first. FileFormat Optional Variant. The format in which the document is saved. Can be any WdSaveFormat constant. To save a document in another format, specify the appropriate value for the SaveFormat property of the FileConverter object. WdSaveFormat can be one of these WdSaveFormat constants. wdFormatDocument Saves as a Microsoft Word document. Default. wdFormatDOSText Saves text without formatting. Converts all section breaks, page breaks, and new line characters to paragraph marks. Uses the ANSI character set. Use this format to share documents between Word and DOS-based programs. wdFormatDOSTextLineBreaks Saves text without formatting. Converts all line breaks, section breaks, and page breaks to paragraph marks. Use this format when you want to maintain line breaks, for example, when transferring documents to an electronic mail system. wdFormatEncodedText Saves as an encoded text file. Use the Encoding argument to specify the code page to use. wdFormatFilteredHTML Saves text with HTML tags with minimal cascading style sheet formatting. The resulting document can be viewed in a Web browser. wdFormatHTML Saves all text and formatting with HTML tags so that the resulting document can be viewed in a Web browser. wdFormatRTF Saves all formatting. Converts formatting to instructions that other programs, including compatible Microsoft programs, can read and interpret. wdFormatTemplate Saves as a Word template. wdFormatText Saves text without formatting. Converts all section breaks, page breaks, and new line characters to paragraph marks. Uses the ANSI character set. Use this format if the destination program cannot read any of the other available file formats. wdFormatTextLineBreaks Saves text without formatting. Converts all line breaks, section breaks, and page breaks to paragraph marks. Use this format when you want to maintain line breaks, for example, when transferring documents to an electronic mail system. wdFormatUnicodeText Saves as a Unicode text file. Converts text between common character encoding standards, including Unicode 2.0, Mac OS, Windows, EUC and ISO-8859 series. wdFormatWebArchive Saves the text, images, and formatting as a single-file Web page. wdFormatXML Saves text and formatting using Extensible Markup Language (XML) and the Word XML schema. Other File Types To save in a file type for which there isn't a constant, use the FileConverters object to obtain the SaveFormat property; then set the FileFormat argument to the value of the SaveFormat property. LockComments Optional Variant. True to lock the document for comments. The default is False. Password Optional Variant. A password string for opening the document. (See Remarks below.) AddToRecentFiles Optional Variant. True to add the document to the list of recently used files on the File menu. The default is True. WritePassword Optional Variant. A password string for saving changes to the document. (See Remarks below.) ReadOnlyRecommended Optional Variant. True to have Microsoft Word suggest read-only status whenever the document is opened. The default is False. EmbedTrueTypeFonts Optional Variant. True to save TrueType fonts with the document. If omitted, the EmbedTrueTypeFonts argument assumes the value of the EmbedTrueTypeFonts property. SaveNativePictureFormat Optional Variant. If graphics were imported from another platform (for example, Macintosh), True to save only the Windows version of the imported graphics. SaveFormsData Optional Variant. True to save the data entered by a user in a form as a data record. SaveAsAOCELetter Optional Variant. If the document has an attached mailer, True to save the document as an AOCE letter (the mailer is saved). Encoding Optional MsoEncoding. The code page, or character set, to use for documents saved as encoded text files. The default is the system code page. MsoEncoding can be one of these MsoEncoding constants. msoEncodingArabic msoEncodingArabicASMO msoEncodingArabicAutoDetect Not used with this method. msoEncodingArabicTransparentASMO msoEncodingAutoDetect Not used with this method. msoEncodingBaltic msoEncodingCentralEuropean msoEncodingCyrillic msoEncodingCyrillicAutoDetect Not used with this method. msoEncodingEBCDICArabic msoEncodingEBCDICDenmarkNorway msoEncodingEBCDICFinlandSweden msoEncodingEBCDICFrance msoEncodingEBCDICGermany msoEncodingEBCDICGreek msoEncodingEBCDICGreekModern msoEncodingEBCDICHebrew msoEncodingEBCDICIcelandic msoEncodingEBCDICInternational msoEncodingEBCDICItaly msoEncodingEBCDICJapaneseKatakanaExtended msoEncodingEBCDICJapaneseKatakanaExtendedAndJapanese msoEncodingEBCDICJapaneseLatinExtendedAndJapanese msoEncodingEBCDICKoreanExtended msoEncodingEBCDICKoreanExtendedAndKorean msoEncodingEBCDICLatinAmericaSpain msoEncodingEBCDICMultilingualROECELatin2 msoEncodingEBCDICRussian msoEncodingEBCDICSerbianBulgarian msoEncodingEBCDICSimplifiedChineseExtendedAndSimplifiedChinese msoEncodingEBCDICThai msoEncodingEBCDICTurkish msoEncodingEBCDICTurkishLatin5 msoEncodingEBCDICUnitedKingdom msoEncodingEBCDICUSCanada msoEncodingEBCDICUSCanadaAndJapanese msoEncodingEBCDICUSCanadaAndTraditionalChinese msoEncodingEUCChineseSimplifiedChinese msoEncodingEUCJapanese msoEncodingEUCKorean msoEncodingEUCTaiwaneseTraditionalChinese msoEncodingEuropa3 msoEncodingExtAlphaLowercase msoEncodingGreek msoEncodingGreekAutoDetect Not used with this method. msoEncodingHebrew msoEncodingHZGBSimplifiedChinese msoEncodingIA5German msoEncodingIA5IRV msoEncodingIA5Norwegian msoEncodingIA5Swedish msoEncodingISO2022CNSimplifiedChinese msoEncodingISO2022CNTraditionalChinese msoEncodingISO2022JPJISX02011989 msoEncodingISO2022JPJISX02021984 msoEncodingISO2022JPNoHalfwidthKatakana msoEncodingISO2022KR msoEncodingISO6937NonSpacingAccent msoEncodingISO885915Latin9 msoEncodingISO88591Latin1 msoEncodingISO88592CentralEurope msoEncodingISO88593Latin3 msoEncodingISO88594Baltic msoEncodingISO88595Cyrillic msoEncodingISO88596Arabic msoEncodingISO88597Greek msoEncodingISO88598Hebrew msoEncodingISO88599Turkish msoEncodingJapaneseAutoDetect Not used with this method. msoEncodingJapaneseShiftJIS msoEncodingKOI8R msoEncodingKOI8U msoEncodingKorean msoEncodingKoreanAutoDetect Not used with this method. msoEncodingKoreanJohab msoEncodingMacArabic msoEncodingMacCroatia msoEncodingMacCyrillic msoEncodingMacGreek1 msoEncodingMacHebrew msoEncodingMacIcelandic msoEncodingMacJapanese msoEncodingMacKorean msoEncodingMacLatin2 msoEncodingMacRoman msoEncodingMacRomania msoEncodingMacSimplifiedChineseGB2312 msoEncodingMacTraditionalChineseBig5 msoEncodingMacTurkish msoEncodingMacUkraine msoEncodingOEMArabic msoEncodingOEMBaltic msoEncodingOEMCanadianFrench msoEncodingOEMCyrillic msoEncodingOEMCyrillicII msoEncodingOEMGreek437G msoEncodingOEMHebrew msoEncodingOEMIcelandic msoEncodingOEMModernGreek msoEncodingOEMMultilingualLatinI msoEncodingOEMMultilingualLatinII msoEncodingOEMNordic msoEncodingOEMPortuguese msoEncodingOEMTurkish msoEncodingOEMUnitedStates msoEncodingSimplifiedChineseAutoDetect Not used with this method. msoEncodingSimplifiedChineseGBK msoEncodingT61 msoEncodingTaiwanCNS msoEncodingTaiwanEten msoEncodingTaiwanIBM5550 msoEncodingTaiwanTCA msoEncodingTaiwanTeleText msoEncodingTaiwanWang msoEncodingThai msoEncodingTraditionalChineseAutoDetect Not used with this method. msoEncodingTraditionalChineseBig5 msoEncodingTurkish msoEncodingUnicodeBigEndian msoEncodingUnicodeLittleEndian msoEncodingUSASCII msoEncodingUTF7 msoEncodingUTF8 msoEncodingVietnamese msoEncodingWestern InsertLineBreaks Optional Variant. If the document is saved as a text file, True to insert line breaks at the end of each line of text. AllowSubstitutions Optional Variant. If the document is saved as a text file, True allows Word to replace some symbols with text that looks similar. For example, displaying the copyright symbol as (c). The default is False. LineEnding Optional Variant. The way Word marks the line and paragraph breaks in documents saved as text files. Can be any WdLineEndingType constant. WdLineEndingType can be one of these WdLineEndingType constants. wdCRLF Default. wdCROnly wdLFCR Not used with this method. wdLFOnly Not used with this method. wdLSPS Not used with this method. AddBiDiMarks Optional Variant. True adds control characters to the output file to preserve bi-directional layout of the text in the original document. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.02.2012, 15:04 |
|
||
|
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов?
|
|||
|---|---|---|---|
|
#18+
Скажите, люди добрые, как правильно добавить параметр на месте "2", хочу сохранить с вставкой разрывов строк и вообще как в этом научиться разбираться? Variant MWODoc; AnsiString fnout = ExtractFilePath(Application->ExeName) + "test.doc"; MWODoc.OleFunction("Open", fnout); AnsiString t = ExtractFilePath(Application->ExeName) + "test.txt"; MWODoc.OleFunction("SaveAs", t, 2); ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.02.2012, 21:37 |
|
||
|
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов?
|
|||
|---|---|---|---|
|
#18+
Вы на чём вообще программируете? Туда и идите ... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.02.2012, 21:54 |
|
||
|
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов?
|
|||
|---|---|---|---|
|
#18+
c++ builder ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.02.2012, 22:08 |
|
||
|
Кто знает как файл .doc программно сохранить в .txt c расстановкой переносов?
|
|||
|---|---|---|---|
|
#18+
А, звиняюсь, не заметил... Тут просто получается интересная вещь. При автоматизации стороннего OLE - приходится всегда помнить, что при построении выражений - синтаксис вы используете "своего" языка; а вот при обращении к объектам модели другого приложения, а также при передаче им параметров - используете синтаксис "стороннего" приложения. Вот вам указали на параметр wdFormatDOSTextLineBreaks для .SaveAs в VBA - придется выяснить значение этого параметра в самом Word, а затем либо передавать значение в принятом в Word формате, либо определить аналогичную по смыслу константу (с нужным значением) "у себя". ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.02.2012, 22:53 |
|
||
|
|

start [/forum/topic.php?fid=61&fpage=109&tid=2176007]: |
0ms |
get settings: |
7ms |
get forum list: |
18ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
54ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
55ms |
get tp. blocked users: |
1ms |
| others: | 246ms |
| total: | 403ms |

| 0 / 0 |
