BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Office Partner Versions Probleme mit Word97 und XP

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
J. Baltisser
Guest





PostPosted: Thu Dec 18, 2003 10:11 pm    Post subject: Office Partner Versions Probleme mit Word97 und XP Reply with quote



Hallo, kann jemand weiter helfen?

Habe ein Problem seit ich OfficePartner auf die neuste Version
geupdaqted habe. Ich erhalte nun vom Compiler einen Fehler da
anscheinend unklar ist welche Unit ich verwenden will (OPwrd97
oder OPwrdXP). Ich müsste eine Versions-spezifische-Methode aufrufen,
habe aber keine Ahnung wie das gehen soll. Der Code sieht in etwa
wie folgt aus (-> siehe weiter unten...)

Die Funktion OpWord.Server.Documents.Add(...) und
OpWord.Server.Documents.AddOld(...)
ergibt im Compiler dann die Fehler-Meldung:
Incompatible Types: 'OpwrdxP_Document' and 'Opwrd97_Document'

Kann mir jemand weiter helfen oder hat jemand eine Idee wie man dies
lösen
könnte? Besten Dank für Hilfe.

mailto: [email]jb (AT) jbaltisser (DOT) ch[/email]

Source Beispiel, das den Fehler erzeugt (OfficePartner 1.64 auf
Word97):

procedure TForm1.Button1Click(Sender: TObject);
var sVers, s, SAdresse: String;
BookmarkName, What, Which, Count : OleVariant;
iDoc : OpWrd97.Document;
begin
OpWord.Free;
OpWord := Nil;
OPWord := TOPWord.Create(OPWord);
OPWord.Connected := True;

OpWord.Visible := False;
WordSave := 'c:TestWordSave.doc';
aTemplate := 'c:Brf.dot';
OleFileFormat := integer(wdFormatDocument);
aDocumentType := wdNewBlankDocument;

sVers := OpWord.Server.Version;
if Copy(sVers, 1,3) = '8.0' Then
begin
iDoc := OpWord.Server.Documents.Add(aTemplate, EmptyParam,
aDocumentType, EmptyParam);
iDoc := OpWord.Server.ActiveDocument;
end;
OpWord.DisplayScrollBars := True;
OpWord.DisplayRecentFiles := True;


// s := iDoc.Get_FullName;
sAdresse := 'test Text Adresse';

BookmarkName := 'TM_Adresse';
What := wdGoToBookmark;
Which := unAssigned;
Count := unAssigned;
With OpWord.Server do // TOpWord
Begin
If IDoc.Bookmarks.Exists('TM_Adresse') Then
Begin
Selection.GoTo_(What, Which, Count, BookmarkName);
Selection.TypeText(sAdresse);
End;
End;
end;
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.