Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Save and SaveAs in Word
Message
From
15/08/2001 10:36:38
 
 
To
14/08/2001 09:24:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00542882
Message ID:
00544080
Views:
19
>>OK,
>>
>>I put the last request in the wrong area. I have a piece of code that Cetin had sent to someone concerning mailmerge
>>I use it to start word allowing the end user to edit filename passed in. Works great except I need to insure end user
>>can not rename the file 1st scenario and Can not access the save or saveas buttons 2 scenario so we can control
>>the name of the file user is working on. Thought adding command
>>
>>oWord = GetObject("","word.basic")
>>
>>With oWord
>> .FileNew(myFile)
>> .appShow
>>*!* Allow user to edit it and then to save it
>>EndWith
>>*!* Use something like this
>> .SaveAs(myFile,".doc")
>>*!* or this...
>> .Save(myFile,".doc")
>> .SaveAs = 0 && False no dialog
>>
>>I get no errors but the saveas and save dialogs always comes up and allows me to do anything...
>>Please Help and thanks in advance...Not Cetin's problem this is my problem not his code failing.
>>
>>Do it Right! Not Over...
>>Cecil
>
>Cecil,
>First IMHO there is no bulletproof way to prevent a user taking a copy of DOC once has right to open in any way. However at least user would understand s/he's getting the copy by brute force.
>Check Thread #485474
>If any approaches there satisfy your needs I could support it by code :)
>Simpliest one is to open document read only. Here is skeleton code for that one ('Save' 'saveas' disabling included) :
>
>
#include "wdconst.h"
>
>oWord = createobject("Word.Application")
>
>lcFile = getfile('DOC')
>if empty(lcfile)
>	return
>endif
>with oWord
>	.Documents.Open(lcFile, ,.T.)
>	.Application.CommandBars("Standard").Controls("Save").Enabled = .F.
>	.Application.CommandBars("File").Controls("Save").Enabled = .F.
>	.Application.CommandBars("File").Controls("SaveAs").Enabled = .F.
>	.visible = .t.
>	start = datetime() && Here simply provide a delay so you could check
>	do while datetime()-start < 60 && they're really disabled
>	enddo
>	* Reset them back -saved in normal.dot !!!
>	.Application.CommandBars("Standard").Controls("Save").Enabled = .T.
>	.Application.CommandBars("File").Controls("Save").Enabled = .T.
>	.Application.CommandBars("File").Controls("SaveAs").Enabled = .T.
>endwith
Cetin

Cretin,

Well I want to say thank you to all the people who have been good enough to answer my question. Will look in archives for copy of wdConst.h these are not part of my msword.h that I created from normal.dot but is this for a specific version of word. Thanks again. Cecil

Cecil

Do it Right! Not Over!!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform