• 15 апреля стартует «Курс «SQL-injection Master» ©» от команды The Codeby

    За 3 месяца вы пройдете путь от начальных навыков работы с SQL-запросами к базам данных до продвинутых техник. Научитесь находить уязвимости связанные с базами данных, и внедрять произвольный SQL-код в уязвимые приложения.

    На последнюю неделю приходится экзамен, где нужно будет показать свои навыки, взломав ряд уязвимых учебных сайтов, и добыть флаги. Успешно сдавшие экзамен получат сертификат.

    Запись на курс до 25 апреля. Получить промодоступ ...

можно ли открыть документ скрытно?

  • Автор темы deeeman
  • Дата начала
T

TIA

Ну не знаю господа, у меня и в первом варианте работает без глюков. Может, дело в содержимом копируемого документа, что в нём?
Только у uidoc.Close не зубудьте True поставить, а то если чуть больше документов отправите на печать, напечатаются только первые цать.
И wObj.Selection.Paste выругается "клипборд пуст", если uidoc был без содержимого.

Код:
Dim ns As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument	
Dim uidoc As NotesUIDocument	
Dim col As NotesDocumentCollection
Dim wObj 

Set wObj = GetObject("","Word.Application")
If wObj Is Nothing Then Set wObj = CreateObject("Word.Application")
wObj.Visible = True
Set db = ns.CurrentDatabase

Set col = ws.CurrentView.Documents
Set doc = col.GetFirstDocument
While Not doc Is Nothing
Set uidoc = ws.EditDocument(False,doc,True)

uidoc.SelectAll
uidoc.Copy
uidoc.Close True

wObj.Documents.Add
wObj.Selection.Paste
wObj.ActiveDocument.Close(False)

Set doc = col.GetNextDocument( doc )
Wend
 

Medevic

Что это ? :)
Green Team
10.12.2004
3 334
1
BIT
4
А почему бы сразу не распечатать выделенные документы? Зачем такой геморрой?
 
T

turumbay

Ну не знаю господа, у меня и в первом варианте работает без глюков. Может, дело в содержимом копируемого документа, что в нём?
Гм. У меня тоже перестала воспроизводица ошибка. Т.е. начала работать конструкция
uidoc = ws.EditDocument( false , doc )
uidoc.SelectAll
uidoc.Copy
...
и source заработал в myQueryClose...
ниче вроде не менялось. вот тока айдишник перещелкивал несколько раз туда-сюда. ln перестраивает ui, закрывает окна в дизайенере - возможно что-то отлипло. вопщем как обычно - трудноуловимые баги ui...
 

lmike

нет, пердело совершенство
Lotus Team
27.08.2008
7 941
609
BIT
216
мда...
еслиб мне такой код (подход - копировать в ворд, через буфер :) ) предложили как решение - "убил бы"
я представляю, что напечатается :p
 
D

deeeman

Господа, всем спасибо!
работает и первый мой код просто нужно uiDoc открывать в режиме редактирования.
 

ToxaRat

Чёрный маг
Green Team
06.11.2007
3 332
42
BIT
0
а не проще ли воспользоваться Doc2RTF?
 
D

deeeman

как именно воспользоваться?
киньте материальчик...
 

ToxaRat

Чёрный маг
Green Team
06.11.2007
3 332
42
BIT
0
deeeman
идешь сюды -
скачиваешь и играешься как тебе нужно
Exporting Notes Documents and Rich Text Fields in RTF Format
October 23, 2002 (updated January 1, 2004)

Here's a database I wrote with some code that allows you to export the information in a Notes rich text field to an RTF file, while retaining most or all of the rich text field formatting. It also demonstrates how to write multiple things to a single RTF file (including multiple rich text fields), if that's something you're interested in doing. Additionally, the techniques involved should allow you to export rich text fields that are greater than 64k in size.

UPDATE: on January 1, 2004 I added functionality to allow you to export an entire Notes document to an RTF file, in addition to just exporting the individual fields. Please be aware that Notes doesn't always do a good job of converting documents from Notes format to RTF format, so documents that have a lot of tables on them (for example) may not export perfectly. The function I wrote that lets you export a document also allows you to specify an alternate form to use for exporting though, so you can always design a special form to use just for sending the doc to RTF.

The RTF file format is the one supported natively by Microsoft Word, so this can also allow you to create your own Word documents from Notes without even needing to have Word installed on your machine! For more information on the RTF format, please check the search engines. Microsoft used to have the version 1.4/Word97 spec available as the file GC0165.exe, although the last time I looked I could only find it buried in the GC1039.exe file here. At the time of this writing, you can also download the version 1.6/Word 2000 spec as the W2KRTFSF.exe file here.

This database was written and tested on an R5 client, and it uses a possibly undocumented API call to "ExportRTF" (which I first saw in this post on the LDD forums). I have no idea what other versions of Notes it will run on, or whether or not this is supported functionality. It is much faster than using OLE to make calls to the Microsoft Word objects to create a DOC file manually, though.

=> Rtftest.zip <=
 
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!