J
jodleren
Hi all!
My client moved to the new office 2009 or vista - the ugly version
with the impossible new menus.
Now, when editing files, when opening it always pops up that
"blocks.docx" blabla and they can select "edit, read only or so"
The point is that the file is a system file I asume, it happens when
word is open with another file, and I open my file (no not that one
above). The file I create is always new, a copy of a "template" where
I should replace some text.
Then is asks what to do with the blocks.docx when I open
"projectnew.doc".
It works with office xp and all.
My code:
try
if VarIsEmpty(WordApplication) then
WordApplication := CreateOleObject('Word.Application');
//WordApplication.Visible := True; {enable this line for
debugging}
WordApplication.DisplayAlerts := wdAlertsNone; // **** this
should take it out???? *****
WordApplication.Documents.Open(ExtractFilePath(ParamStr(0)) +
TempFile); // ******* it happens here! ******
Hwnd := FindWindow('OpusApp', PChar('Microsoft Word - ' +
ExtractFileName(TempFile)));
TempStr := '17';
WordApplication.ActiveDocument.Content.Find.Execute(FindText :=
'¤offerno¤', ReplaceWith := TempStr);
WordApplication.ActiveDocument.Save;
finally
if not VarIsEmpty(WordApplication) then
begin
WordApplication.ActiveDocument.Saved := True;
WordApplication.Quit;
end;
end;
My client moved to the new office 2009 or vista - the ugly version
with the impossible new menus.
Now, when editing files, when opening it always pops up that
"blocks.docx" blabla and they can select "edit, read only or so"
The point is that the file is a system file I asume, it happens when
word is open with another file, and I open my file (no not that one
above). The file I create is always new, a copy of a "template" where
I should replace some text.
Then is asks what to do with the blocks.docx when I open
"projectnew.doc".
It works with office xp and all.
My code:
try
if VarIsEmpty(WordApplication) then
WordApplication := CreateOleObject('Word.Application');
//WordApplication.Visible := True; {enable this line for
debugging}
WordApplication.DisplayAlerts := wdAlertsNone; // **** this
should take it out???? *****
WordApplication.Documents.Open(ExtractFilePath(ParamStr(0)) +
TempFile); // ******* it happens here! ******
Hwnd := FindWindow('OpusApp', PChar('Microsoft Word - ' +
ExtractFileName(TempFile)));
TempStr := '17';
WordApplication.ActiveDocument.Content.Find.Execute(FindText :=
'¤offerno¤', ReplaceWith := TempStr);
WordApplication.ActiveDocument.Save;
finally
if not VarIsEmpty(WordApplication) then
begin
WordApplication.ActiveDocument.Saved := True;
WordApplication.Quit;
end;
end;