Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / FoxPro, Visual FoxPro [игнор отключен] [закрыт для гостей] / работа с вордом / 7 сообщений из 7, страница 1 из 1
16.02.2006, 22:11
    #33550547
фокс
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
работа с вордом
открываю документ ворда:

loword=createobject("word.application")
loword.documents.open("c:\DOCUM."+tip)
loword.visible=.t.

как бы мне его сделать протект, в смысле защиту от редактирования..

говорит что эти свойства для чтения только, или я не то делаю?

подскажите плз. если кто делал.
...
Рейтинг: 0 / 0
16.02.2006, 23:04
    #33550610
ВладимирМ
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
работа с вордом
А ты почитай HELP в самом Word на метод Documents.Open(). У него 3 параметр - это как раз признак, открывать ли документ только на чтение

HELP VBA WordOpen method as it applies to the Documents object.

Opens the specified document and adds it to the Documents collection. Returns a Document object.

expression . Open(FileName, ConfirmConversions, ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Format, Encoding, Visible, OpenConflictDocument, OpenAndRepair , DocumentDirection, NoEncodingDialog)

expression Required. An expression that returns a Documents object.

FileName Required Variant . The name of the document (paths are accepted).

ConfirmConversions Optional Variant . True to display the Convert File dialog box if the file isn't in Microsoft Word format.

ReadOnly Optional Variant . True to open the document as read-only. Note This argument doesn't override the read-only recommended setting on a saved document. For example, if a document has been saved with read-only recommended turned on, setting the ReadOnly argument to False will not cause the file to be opened as read/write.

AddToRecentFiles Optional Variant . True to add the file name to the list of recently used files at the bottom of the File menu.

PasswordDocument Optional Variant . The password for opening the document.

PasswordTemplate Optional Variant . The password for opening the template.

Revert Optional Variant . Controls what happens if FileName is the name of an open document. True to discard any unsaved changes to the open document and reopen the file. False to activate the open document.

WritePasswordDocument Optional Variant . The password for saving changes to the document.

WritePasswordTemplate Optional Variant . The password for saving changes to the template.

Format Optional Variant . The file converter to be used to open the document. Can be one of the following WdOpenFormat constants.

WdOpenFormat can be one of these WdOpenFormat constants.
wdOpenFormatAllWord
wdOpenFormatAuto The default value.
wdOpenFormatDocument
wdOpenFormatEncodedText
wdOpenFormatRTF
wdOpenFormatTemplate
wdOpenFormatText
wdOpenFormatUnicodeText
wdOpenFormatWebPages

To specify an external file format, apply the OpenFormat property to a FileConverter object to determine the value to use with this argument.

Encoding Optional Variant . The document encoding (code page or character set) to be used by Microsoft Word when you view the saved document. Can be any valid MsoEncoding constant. For the list of valid MsoEncoding constants, see the Object Browser in the Visual Basic Editor. The default value is the system code page.

Visible Optional Variant . True if the document is opened in a visible window. The default value is True .

OpenConflictDocument Optional Variant . Specifies whether to open the conflict file for a document with an offline conflict.

OpenAndRepair Optional Variant . True to repair the document to prevent document corruption.

DocumentDirection Optional WdDocumentDirection . Indicates the horizontal flow of text in a document.

WdDocumentDirection can be one of these WdDocumentDirection constants.
wdLeftToRight default
wdRightToLeft

NoEncodingDialog Optional Variant . True to skip displaying the Encoding dialog box that Word displays if the text encoding cannot be recognized. The default value is False .
...
Рейтинг: 0 / 0
17.02.2006, 00:44
    #33550679
фокс
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
работа с вордом
Большое спасибо! Все работает!

теперь другой вопрос возник,
как заставить программу не просто пробегать все команды, а ждать пока я с вордом отработаю и закрою окно?

наверняка есть метод приостановить выполнение кода до закрытия окна?
...
Рейтинг: 0 / 0
17.02.2006, 10:21
    #33551025
ВладимирМ
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
работа с вордом
Может имеет смысл вместо отдельного приложения Word разместить внутри стандартной формы компонент Ole?

Как это сделать посмотри стандартный проект примеров

Код: plaintext
MODIFY PROJECT (Home( 2 )+"Solution\solution.pjx")

Форма OleWord.scx
...
Рейтинг: 0 / 0
Период между сообщениями больше года.
18.09.2008, 15:40
    #35546840
Алексей (Витебск)
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
работа с вордом
ВладимирММожет имеет смысл вместо отдельного приложения Word разместить внутри стандартной формы компонент Ole?

Как это сделать посмотри стандартный проект примеров

Код: plaintext
MODIFY PROJECT (Home( 2 )+"Solution\solution.pjx")

Форма OleWord.scx

Здравствуйте. Давно все уже было,
но вот мне понадобилось как раз разместить
на форме.
Посмотрел Solution, но так и не понял
(после многочисленных экспериментов - документации особо нету),
как на форме не новый документ разместить, а открыть уже существующий.
Может быть, подскажете?

Спасибо.
...
Рейтинг: 0 / 0
18.09.2008, 15:49
    #35546864
Dima T
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
работа с вордом
Тут подобную проблему обсуждали
...
Рейтинг: 0 / 0
18.09.2008, 16:09
    #35546932
Алексей (Витебск)
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
работа с вордом
Спасибо
...
Рейтинг: 0 / 0
Форумы / FoxPro, Visual FoxPro [игнор отключен] [закрыт для гостей] / работа с вордом / 7 сообщений из 7, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]