English
Forum

Print Preview MS-Word

 

Normann
Strübli
Hi,

I have straight so started one small Program To write
which Meßwerte into vorgegebenes log write should.
there the log something komplizierter looks
(with tables, Graphics, Fußnoten etc.) have I decided the log in MS-Word (2002) to create instead of it costly somehow
with Profan To release :roll:
around the individual Strings and values now on The right position in the
document To get has each area a eindeutigen names -z.B: |1202. The .doc-File now with Profan opened and the Feldnamen with the desired Zeichenketten supplant - Voila! Klappt super
now but to that trouble:

there the Prüfprotokoll one wichtiges document is would like I it to
Changes/ fake protect. The first Maßnahme The The for
met have is the Checksumme the modified .doc File To detect and to print. so can if necessary fixes go
whether something in the document changed watts. though be I with the Solution not yet integrally pleased.
is it means possible in Word directly The Print Preview view - or yet rather the document to print without Word loading To must? evtl. via kommandozeilen-parameter? have unfortunately in the network and the Word- Help nothing moreover found - but Perhaps white here Yes random jmd. something above.

gruß
Normann
 
01/26/05  
 



from very this Grunde recommend I you [...] 

there make You your Vorlagen in the stature .sdc - and a shellexec print instruction can the OOffice Print like a baby - without lästige inquiries.

Search time here in the Community to binprint - faith I had Schonmal ne Inc gebastelt for which myself Nutze circa different Clients over networking print let to - and everything in the Nachhinein too yet Nachvollziebar remaining.

salvo, iF
 
01/26/05  
 




Normann
Strübli
thanks iF for speedy response - werd me time well time with OpenOffice keep busy must but with Word werd I nevertheless weitertüfteln.
From whom was again The Presentation one fremdes Program in the own Profanfenster to execute- sozusagen einzufangen. can me only yet very dark on it remind...
on the side I find it cool How You the community again aufgebaut have, one feel itself again integrally How home
 
01/26/05  
 




Jörg
Sellmeyer
Hello Normann,
really müßtest You with ShellExec(Document.doc,Print,0) Word invisible started can around the document directly to print.
Greeting
Jörg
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
01/26/05  
 



@Norman: thanks

@Jörg: unfortunately goes it so with word not - there otherwise Perhaps even the PrinterDialog not displayed would.

The problem with word is hold simply the to the expression one PrinterDialog comes - with OO is this hold not the case. and there many companies a Lizensverwaltung introduced having - is one with OO on the secure Page.

salvo, iF
 
01/27/05  
 




Normann
Strübli
The suggestion of Jörg is functions but -if Word neither invisible launched becomes, so becomes the document on whom printer sent and Word subsequently again closed.
foreseen of it must I it at least for Word yet rather solve - if one times not with the Standarddrucker print wants - time bad.

gruß
Normann
 
01/27/05  
 



alas Real? Lol I had it with OfficeXP probiert and there coming always the lästige PrinterDLG. Sag still - which Word-Version uses You?

salvo, iF
 
01/28/05  
 




Jörg
Sellmeyer
Hello Normann,
From Sebastian king Gibts a OleFile.prf. sees quite klompiziert from,
abervielleicht can You what so begin.
CompileMarkSeparation
+-----------------------------------------------------------------------+
| olefile.prf - Dateien öffnen und schließen mit OLE                    |
| Autor: Sebastian König                                                |
| email: feedback@sekoenig.de                                           |
| Homepage: http://www.sekoenig.de                                      |
| Copyright ©2001 Sebastian König                                       |
|                                                                       |
| Dieser Quellcode zeigt, wie man mit OLE und Profan² ein Word-Dokument |
| zum Bearbeiten öffnet.                                                |
|                                                                       |
|                                                                       |
| WICHTIG: Dieser Quellcode funktioniert erst ab Profan 7.0 und setzt   |
|          voraus, dass Microsoft® Word installiert ist.                |
|                                                                       |
| TIP(P):  Diese Methode funktioniert nicht nur mit Word-Dokumenten.    |
|          Wenn man die Dateimaske zum Beispiel in *.bmp ändert, wird   |
|          automatisch Paint (oder ein anderes Zeichenprogramm)         |
|          geöffnet.                                                    |
|                                                                       |
+-----------------------------------------------------------------------+
---Prozeduren

proc Release

    parameters obj&
    declare vptr&
    let vptr& = @long(obj&,0)
    return Call(@long(vptr&,8),obj&)

endproc

+++
---Benötigte (COM/OLE)-API-Funktionen:
DEF OleInitialize(1) !"OLE32","OleInitialize"
DEF OleUninitialize(0) !"OLE32","OleUninitialize"
DEF IIDFromString(2) !"OLE32","IIDFromString"
DEF CoTaskMemAlloc(1) !"OLE32","CoTaskMemAlloc"
DEF CoTaskMemFree(1) !"OLE32","CoTaskMemFree"
DEF CreateILockBytesOnHGlobal(3) !"OLE32","CreateILockBytesOnHGlobal"
DEF StgCreateDocfileOnILockBytes(4) !"OLE32","StgCreateDocfileOnILockBytes"
DEF OleCreateFromFile(8) !"OLE32","OleCreateFromFile"
DEF MultiByteToWideChar(6) !"KERNEL32","MultiByteToWideChar"
DEF Sleep(1) !"KERNEL32","Sleep"
---Variablen deklarieren:
declare ILockBytes&,IStorage&,IOleClientSite&,IRichEditOle&,MSWord&,IUnknown&
declare vp_MSWord&,vp_RTFOle&
declare CLSID_MSWord&,IID_IOleObject&,IID_IOleClientSite&,IID_IUnknown&
declare clsid$,iid$,olestr&
declare file$,file&
declare FORMATETC#,RECT#,MSG#
declare count&
---Speicher allokieren:
let ILockBytes& = CoTaskMemAlloc(4)
let IStorage& = CoTaskMemAlloc(4)
let MSWord& = CoTaskMemAlloc(4)
let IID_IOleObject& = CoTaskMemAlloc(16)
let olestr& = CoTaskMemAlloc(256)
let file& = CoTaskMemAlloc(1024)
dim FORMATETC#,20
---Neues Fenster erstellen:
windowtitle "OLE mit Profan²"
window 100,100-640,480
---OLE initialisieren:
print "OleInitialize:",OleInitialize(0),"
"
---Storage-Objekt erstellen:
print "CreateILockBytesOnHGlobal:",CreateILockBytesOnHGlobal(0,1,Addr(ILockBytes&)),"
"
print "StgCreateDocfileOnILockBytes:",StgCreateDocfileOnILockBytes(ILockBytes&,$1012,0,Addr(IStorage&)),"
"
---MSWord-Objekt erstellen:
--IID für IOleObject aus String bilden:
let iid$ = "{00000112-0000-0000-C000-000000000046}"
MultiByteToWideChar(0,0,Addr(iid$),Len(iid$),olestr&,261),"
"
print "IIDFromString:",IIDFromString(olestr&,IID_IOleObject&),"
"
--Datei wählen
let file$ = LoadFile$("Word-Dokumente","*.doc")
MultiByteToWideChar(0,0,Addr(file$),Len(file$),file&,261),"
"
--FORMATETC# füllen...
long FORMATETC#,0  = 0
long FORMATETC#,4  = 0
long FORMATETC#,8  = 1 DVASPECT_CONTENT
long FORMATETC#,12 = 0
long FORMATETC#,16 = 0 TYMED_NULL
--Objekt erstellen:
print "OleCreateFromFile:",OleCreateFromFile(0,file&,IID_IOleObject&,0,FORMATETC#,0,IStorage&,Addr(MSWord&)),"
"
--vptr ermitteln:
let vp_MSWord& = @long(MSWord&,0)
MessageBox("Die Datei wird nun geöffnet und in ca. 5 Sekunden
automatisch wieder geschlossen.","Meldung",64)
---Objekt zum Bearbeiten öffnen:
print "MSWord&->DoVerb:",Call(@long(vp_MSWord&,44),MSWord&,-1,0,0,0,%hwnd,0)
---5 Sekunden warten, ohne den Prozess zu blockieren:
let count& = @add(&GetTickCount,5000)

while @lt(&GetTickCount,count&)

    Sleep(0)

wend

---Objekt wieder schließen:
print "MSWord&->Close:",Call(@long(vp_MSWord&,24),MSWord&,0)
print " "
print "> Taste oder Mausklick zum Beenden! <"
waitinput
---Aufräumarbeiten:
Release MSWord&
Release IStorage&
Release ILockBytes&
CoTaskMemFree(ILockBytes&)
CoTaskMemFree(IStorage&)
CoTaskMemFree(MSWord&)
CoTaskMemFree(CLSID_MSWord&)
CoTaskMemFree(IID_IOleObject&)
CoTaskMemFree(olestr&)
dispose FORMATETC#
OleUninitialize()
---./../Function-References/XProfan/end/'>end:
end

Greeting
Jörg
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
01/28/05  
 




Normann
Strübli
[quote:efc5161f7d]which Word-Version uses You?[/quote:efc5161f7d]
Have quite no Word
can the only office testing and there's office Xp installs, hmm...

the Example of Sebastian must I first yet work up -or rather said understand, crashes too unfortunately with of/ one Exeption EAccessVioaltion ex.
 
01/28/05  
 




CB
Hi, Normann!

meant You subesquent Link?

[...] 

i'm I do not integrally sure, whether it this is, what You achieve want, but Perhaps helps you the following moreover:

I have you one small Word-macro gebastelt (Ver 97, run should it In any drop his To incl. Word XP - higher Have I do not )
what this macro yet missing, is the request, whether the expression already is done, because itself Word otherwise möglicherweise beschwert, that it exits go should, wos still with the Print not yet is done!

NewMakros.txt rename in *.bas.
VisualBasic-editor open - File import - Link to .bas - editor leave - Save (not forget!) - testing with irgendeinem doc.
Next step: You erstellst you a Presentation (SinnvollerName.dot) and position this macro dorthinein (Makros - organize - copy)

After the schema from my Link can You then from Your Profan-Program out Word started - a macro automatically perform let (DruckenStdBeenden) and Word becomes automatically again closed (Application.Quit machts possible).
another hint: (not ausprobiert): WinExec(Wait) can You as Parameter whom Abbildungsmodus transfer - Perhaps druckt Word too minimizes (mode 2)?

there's another Possibility: look times under whom Units in the Forum to:
Michael Dell has there a Deco.inc published to that Codieren and Decodieren - Perhaps can Dus need (before You what on Word mail..).

If You Problems having with my Beispielcode - i'm (almost) each day online...

Christian

1 kB
Hochgeladen:01/28/05
Downloadcounter77
Download
 
XProfan 8/9.1, Win XP, AMD 64/3200
01/28/05  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.072 Views

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie