Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Thu, 22 Dec 2005 18:05:02 +0100,    group: microsoft.public.word.vba.addins        back       


Outlook blocks Word add-in :-(   
Hi all

Help is very much needed here:

I have created a word.dot file and placed it in Words Startup folder. When I 
open Word the add-in reads some files, adds a new menuitem in word, and it 
all works fine.

When it goes very bad:
- Start my pc
- Open Outlook2003 (using Word as email editor)
   I can now see that a WINWORD.EXE session is opened on the pc, and that my 
add-in is opened as well
- Open Word and nothing happens

It seems like Outlook opens my Word Add-in with out running the AutoExec and 
AutoOpen...
and when I open Word it seems like Word says - oh the add-in file is already 
opened by Word (the Outlook session) so Word does not run the AutoExec and 
AutoOpen.


I don't my amount of spend time here - PLEASE help me get a solution here or 
to report the posible "bug" to Microsoft.

Thanks
Flemming, Denmark

Posted both in microsoft.public.outlook.program_addins and 
microsoft.public.word.vba.addins
date: Thu, 22 Dec 2005 18:05:02 +0100   author:   Flemming Dahl

Re: Outlook blocks Word add-in :-(   
It's a problem that we all face.  The only way around it is to start/have 
your users start Word FIRST.

-- 
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Flemming Dahl"  wrote in message 
news:uZXnanxBGHA.1092@TK2MSFTNGP09.phx.gbl...
> Hi all
>
> Help is very much needed here:
>
> I have created a word.dot file and placed it in Words Startup folder. When 
> I open Word the add-in reads some files, adds a new menuitem in word, and 
> it all works fine.
>
> When it goes very bad:
> - Start my pc
> - Open Outlook2003 (using Word as email editor)
>   I can now see that a WINWORD.EXE session is opened on the pc, and that 
> my add-in is opened as well
> - Open Word and nothing happens
>
> It seems like Outlook opens my Word Add-in with out running the AutoExec 
> and AutoOpen...
> and when I open Word it seems like Word says - oh the add-in file is 
> already opened by Word (the Outlook session) so Word does not run the 
> AutoExec and AutoOpen.
>
>
> I don't my amount of spend time here - PLEASE help me get a solution here 
> or to report the posible "bug" to Microsoft.
>
> Thanks
> Flemming, Denmark
>
> Posted both in microsoft.public.outlook.program_addins and 
> microsoft.public.word.vba.addins
>
date: Sat, 24 Dec 2005 11:46:12 +0100   author:   Doug Robbins - Word MVP

Re: Outlook blocks Word add-in :-(   
Thank you for your reply Doug.

I had hoped for a better solution than "It's a bug in MS Office".

Do you know if it is reportet to Microsoft? or where to do so?

Thanks,
Flemming



"Doug Robbins - Word MVP"  wrote in message 
news:OJ9jDdHCGHA.2320@TK2MSFTNGP11.phx.gbl...
> It's a problem that we all face.  The only way around it is to start/have 
> your users start Word FIRST.
>
> -- 
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "Flemming Dahl"  wrote in message 
> news:uZXnanxBGHA.1092@TK2MSFTNGP09.phx.gbl...
>> Hi all
>>
>> Help is very much needed here:
>>
>> I have created a word.dot file and placed it in Words Startup folder. 
>> When I open Word the add-in reads some files, adds a new menuitem in 
>> word, and it all works fine.
>>
>> When it goes very bad:
>> - Start my pc
>> - Open Outlook2003 (using Word as email editor)
>>   I can now see that a WINWORD.EXE session is opened on the pc, and that 
>> my add-in is opened as well
>> - Open Word and nothing happens
>>
>> It seems like Outlook opens my Word Add-in with out running the AutoExec 
>> and AutoOpen...
>> and when I open Word it seems like Word says - oh the add-in file is 
>> already opened by Word (the Outlook session) so Word does not run the 
>> AutoExec and AutoOpen.
>>
>>
>> I don't my amount of spend time here - PLEASE help me get a solution here 
>> or to report the posible "bug" to Microsoft.
>>
>> Thanks
>> Flemming, Denmark
>>
>> Posted both in microsoft.public.outlook.program_addins and 
>> microsoft.public.word.vba.addins
>>
>
>
date: Sat, 24 Dec 2005 12:28:28 +0100   author:   Flemming Dahl

Re: Outlook blocks Word add-in :-(   
Rather than being a bug, I believe that it is "by design", related to 
security issues - Damn Virus Kiddies.

See the Knowledge Base Article at 
http://support.microsoft.com/kb/286310/en-us

-- 
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Flemming Dahl"  wrote in message 
news:O%23dzq0HCGHA.1288@TK2MSFTNGP09.phx.gbl...
> Thank you for your reply Doug.
>
> I had hoped for a better solution than "It's a bug in MS Office".
>
> Do you know if it is reportet to Microsoft? or where to do so?
>
> Thanks,
> Flemming
>
>
>
> "Doug Robbins - Word MVP"  wrote in message 
> news:OJ9jDdHCGHA.2320@TK2MSFTNGP11.phx.gbl...
>> It's a problem that we all face.  The only way around it is to start/have 
>> your users start Word FIRST.
>>
>> -- 
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "Flemming Dahl"  wrote in message 
>> news:uZXnanxBGHA.1092@TK2MSFTNGP09.phx.gbl...
>>> Hi all
>>>
>>> Help is very much needed here:
>>>
>>> I have created a word.dot file and placed it in Words Startup folder. 
>>> When I open Word the add-in reads some files, adds a new menuitem in 
>>> word, and it all works fine.
>>>
>>> When it goes very bad:
>>> - Start my pc
>>> - Open Outlook2003 (using Word as email editor)
>>>   I can now see that a WINWORD.EXE session is opened on the pc, and that 
>>> my add-in is opened as well
>>> - Open Word and nothing happens
>>>
>>> It seems like Outlook opens my Word Add-in with out running the AutoExec 
>>> and AutoOpen...
>>> and when I open Word it seems like Word says - oh the add-in file is 
>>> already opened by Word (the Outlook session) so Word does not run the 
>>> AutoExec and AutoOpen.
>>>
>>>
>>> I don't my amount of spend time here - PLEASE help me get a solution 
>>> here or to report the posible "bug" to Microsoft.
>>>
>>> Thanks
>>> Flemming, Denmark
>>>
>>> Posted both in microsoft.public.outlook.program_addins and 
>>> microsoft.public.word.vba.addins
>>>
>>
>>
>
>
date: Sat, 24 Dec 2005 21:58:25 +0100   author:   Doug Robbins - Word MVP

Re: Outlook blocks Word add-in :-(   
You might be right - and yes - Damn Virus Kiddies.

Couldn't I make a add-in for outlook to start Adds a menuitem to the hidden 
Word session, so that when word is started the menuitem can be found, at the 
word add-in will provide the codebehind ?

..... any comments on that idea?



"Doug Robbins - Word MVP"  wrote in message 
news:OzmVLzMCGHA.2840@TK2MSFTNGP12.phx.gbl...
> Rather than being a bug, I believe that it is "by design", related to 
> security issues - Damn Virus Kiddies.
>
> See the Knowledge Base Article at 
> http://support.microsoft.com/kb/286310/en-us
>
> -- 
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "Flemming Dahl"  wrote in message 
> news:O%23dzq0HCGHA.1288@TK2MSFTNGP09.phx.gbl...
>> Thank you for your reply Doug.
>>
>> I had hoped for a better solution than "It's a bug in MS Office".
>>
>> Do you know if it is reportet to Microsoft? or where to do so?
>>
>> Thanks,
>> Flemming
>>
>>
>>
>> "Doug Robbins - Word MVP"  wrote in message 
>> news:OJ9jDdHCGHA.2320@TK2MSFTNGP11.phx.gbl...
>>> It's a problem that we all face.  The only way around it is to 
>>> start/have your users start Word FIRST.
>>>
>>> -- 
>>> Hope this helps.
>>>
>>> Please reply to the newsgroup unless you wish to avail yourself of my
>>> services on a paid consulting basis.
>>>
>>> Doug Robbins - Word MVP
>>>
>>> "Flemming Dahl"  wrote in message 
>>> news:uZXnanxBGHA.1092@TK2MSFTNGP09.phx.gbl...
>>>> Hi all
>>>>
>>>> Help is very much needed here:
>>>>
>>>> I have created a word.dot file and placed it in Words Startup folder. 
>>>> When I open Word the add-in reads some files, adds a new menuitem in 
>>>> word, and it all works fine.
>>>>
>>>> When it goes very bad:
>>>> - Start my pc
>>>> - Open Outlook2003 (using Word as email editor)
>>>>   I can now see that a WINWORD.EXE session is opened on the pc, and 
>>>> that my add-in is opened as well
>>>> - Open Word and nothing happens
>>>>
>>>> It seems like Outlook opens my Word Add-in with out running the 
>>>> AutoExec and AutoOpen...
>>>> and when I open Word it seems like Word says - oh the add-in file is 
>>>> already opened by Word (the Outlook session) so Word does not run the 
>>>> AutoExec and AutoOpen.
>>>>
>>>>
>>>> I don't my amount of spend time here - PLEASE help me get a solution 
>>>> here or to report the posible "bug" to Microsoft.
>>>>
>>>> Thanks
>>>> Flemming, Denmark
>>>>
>>>> Posted both in microsoft.public.outlook.program_addins and 
>>>> microsoft.public.word.vba.addins
>>>>
>>>
>>>
>>
>>
>
>
date: Sat, 24 Dec 2005 23:40:54 +0100   author:   Flemming Dahl

Re: Outlook blocks Word add-in :-(   
I suggest that you ask that question in an Outlook newsgroup.

-- 
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Flemming Dahl"  wrote in message 
news:umXxasNCGHA.2920@tk2msftngp13.phx.gbl...
> You might be right - and yes - Damn Virus Kiddies.
>
> Couldn't I make a add-in for outlook to start Adds a menuitem to the 
> hidden Word session, so that when word is started the menuitem can be 
> found, at the word add-in will provide the codebehind ?
>
> .... any comments on that idea?
>
>
>
> "Doug Robbins - Word MVP"  wrote in message 
> news:OzmVLzMCGHA.2840@TK2MSFTNGP12.phx.gbl...
>> Rather than being a bug, I believe that it is "by design", related to 
>> security issues - Damn Virus Kiddies.
>>
>> See the Knowledge Base Article at 
>> http://support.microsoft.com/kb/286310/en-us
>>
>> -- 
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "Flemming Dahl"  wrote in message 
>> news:O%23dzq0HCGHA.1288@TK2MSFTNGP09.phx.gbl...
>>> Thank you for your reply Doug.
>>>
>>> I had hoped for a better solution than "It's a bug in MS Office".
>>>
>>> Do you know if it is reportet to Microsoft? or where to do so?
>>>
>>> Thanks,
>>> Flemming
>>>
>>>
>>>
>>> "Doug Robbins - Word MVP"  wrote in message 
>>> news:OJ9jDdHCGHA.2320@TK2MSFTNGP11.phx.gbl...
>>>> It's a problem that we all face.  The only way around it is to 
>>>> start/have your users start Word FIRST.
>>>>
>>>> -- 
>>>> Hope this helps.
>>>>
>>>> Please reply to the newsgroup unless you wish to avail yourself of my
>>>> services on a paid consulting basis.
>>>>
>>>> Doug Robbins - Word MVP
>>>>
>>>> "Flemming Dahl"  wrote in message 
>>>> news:uZXnanxBGHA.1092@TK2MSFTNGP09.phx.gbl...
>>>>> Hi all
>>>>>
>>>>> Help is very much needed here:
>>>>>
>>>>> I have created a word.dot file and placed it in Words Startup folder. 
>>>>> When I open Word the add-in reads some files, adds a new menuitem in 
>>>>> word, and it all works fine.
>>>>>
>>>>> When it goes very bad:
>>>>> - Start my pc
>>>>> - Open Outlook2003 (using Word as email editor)
>>>>>   I can now see that a WINWORD.EXE session is opened on the pc, and 
>>>>> that my add-in is opened as well
>>>>> - Open Word and nothing happens
>>>>>
>>>>> It seems like Outlook opens my Word Add-in with out running the 
>>>>> AutoExec and AutoOpen...
>>>>> and when I open Word it seems like Word says - oh the add-in file is 
>>>>> already opened by Word (the Outlook session) so Word does not run the 
>>>>> AutoExec and AutoOpen.
>>>>>
>>>>>
>>>>> I don't my amount of spend time here - PLEASE help me get a solution 
>>>>> here or to report the posible "bug" to Microsoft.
>>>>>
>>>>> Thanks
>>>>> Flemming, Denmark
>>>>>
>>>>> Posted both in microsoft.public.outlook.program_addins and 
>>>>> microsoft.public.word.vba.addins
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
date: Sun, 25 Dec 2005 08:06:56 +0100   author:   Doug Robbins - Word MVP

Re: Outlook blocks Word add-in :-(   
A sDoug as said, this is annoying but the way Word & Outlook work together. 
If you are using Word as the email editor for outlook, then you cannot 
assume that the AutoExec macro in a Word Add-in will fire.

Once you accept this as expected behavior, then the nature of the necessary 
workaround is fairly straightforward. If your add-in has any user interface 
items, then any macros triggered by them must first check to see if AutoExec 
has been run (you can have it set a public Boolean variable when AutoExec 
has finished), and run it immediately if it has not been run.


-- 
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup



"Flemming Dahl"  wrote in message 
news:uZXnanxBGHA.1092@TK2MSFTNGP09.phx.gbl...
> Hi all
>
> Help is very much needed here:
>
> I have created a word.dot file and placed it in Words Startup folder. When 
> I open Word the add-in reads some files, adds a new menuitem in word, and 
> it all works fine.
>
> When it goes very bad:
> - Start my pc
> - Open Outlook2003 (using Word as email editor)
>   I can now see that a WINWORD.EXE session is opened on the pc, and that 
> my add-in is opened as well
> - Open Word and nothing happens
>
> It seems like Outlook opens my Word Add-in with out running the AutoExec 
> and AutoOpen...
> and when I open Word it seems like Word says - oh the add-in file is 
> already opened by Word (the Outlook session) so Word does not run the 
> AutoExec and AutoOpen.
>
>
> I don't my amount of spend time here - PLEASE help me get a solution here 
> or to report the posible "bug" to Microsoft.
>
> Thanks
> Flemming, Denmark
>
> Posted both in microsoft.public.outlook.program_addins and 
> microsoft.public.word.vba.addins
>
date: Mon, 26 Dec 2005 15:34:21 -0000   author:   Jonathan West

Re: Outlook blocks Word add-in :-(   
Hi Jonathan

Thanks for your participation on this issue - and I see your point - but...

AutoExec fires a macro that adds a new menuitem next right next to the 
"Help" menu item in Word.

When AutoExec have not been fired the menuitem have not been created... => 
nothing to press => no way to check a boolean.


Regards,
Flemming



"Jonathan West"  wrote in message 
news:e61PtNjCGHA.344@TK2MSFTNGP11.phx.gbl...
>A sDoug as said, this is annoying but the way Word & Outlook work together. 
>If you are using Word as the email editor for outlook, then you cannot 
>assume that the AutoExec macro in a Word Add-in will fire.
>
> Once you accept this as expected behavior, then the nature of the 
> necessary workaround is fairly straightforward. If your add-in has any 
> user interface items, then any macros triggered by them must first check 
> to see if AutoExec has been run (you can have it set a public Boolean 
> variable when AutoExec has finished), and run it immediately if it has not 
> been run.
>
>
> -- 
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
>
>
> "Flemming Dahl"  wrote in message 
> news:uZXnanxBGHA.1092@TK2MSFTNGP09.phx.gbl...
>> Hi all
>>
>> Help is very much needed here:
>>
>> I have created a word.dot file and placed it in Words Startup folder. 
>> When I open Word the add-in reads some files, adds a new menuitem in 
>> word, and it all works fine.
>>
>> When it goes very bad:
>> - Start my pc
>> - Open Outlook2003 (using Word as email editor)
>>   I can now see that a WINWORD.EXE session is opened on the pc, and that 
>> my add-in is opened as well
>> - Open Word and nothing happens
>>
>> It seems like Outlook opens my Word Add-in with out running the AutoExec 
>> and AutoOpen...
>> and when I open Word it seems like Word says - oh the add-in file is 
>> already opened by Word (the Outlook session) so Word does not run the 
>> AutoExec and AutoOpen.
>>
>>
>> I don't my amount of spend time here - PLEASE help me get a solution here 
>> or to report the posible "bug" to Microsoft.
>>
>> Thanks
>> Flemming, Denmark
>>
>> Posted both in microsoft.public.outlook.program_addins and 
>> microsoft.public.word.vba.addins
>>
>
>
date: Mon, 26 Dec 2005 21:58:40 +0100   author:   Flemming Dahl

Re: Outlook blocks Word add-in :-(   
"Flemming Dahl"  wrote in message 
news:Obg0m8lCGHA.3984@TK2MSFTNGP14.phx.gbl...
> Hi Jonathan
>
> Thanks for your participation on this issue - and I see your point - 
> but...
>
> AutoExec fires a macro that adds a new menuitem next right next to the 
> "Help" menu item in Word.
>
> When AutoExec have not been fired the menuitem have not been created... => 
> nothing to press => no way to check a boolean.


Oh, I've had a similar problem - a dynamic menu that needed to be built on 
loading the add-in. There's a workaround for that. Place an ordinary 
commandbarbutton on the menu. Set its ActionControl property to a macro that 
replaces the button with the menu you want and then performs the Execute 
method on the menu to drop it down. The user will have no idea that what he 
has just clicked was originally a button that has disappeared and turned 
into a menu.


-- 
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
date: Tue, 27 Dec 2005 14:05:43 -0000   author:   Jonathan West

Re: Outlook blocks Word add-in :-(   
If it's a WordMail item (Window.EnvelopeVisible = True) then you would get 
an Outlook NewInspector event from the Inspectors collection each time a new 
email was opened. Using that event you can check for Inspector.IsWordMail = 
True to verify the item is using WordMail. Then you can add your button to 
whatever CustomizationContext you choose.

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Flemming Dahl"  wrote in message 
news:Obg0m8lCGHA.3984@TK2MSFTNGP14.phx.gbl...
> Hi Jonathan
>
> Thanks for your participation on this issue - and I see your point - 
> but...
>
> AutoExec fires a macro that adds a new menuitem next right next to the 
> "Help" menu item in Word.
>
> When AutoExec have not been fired the menuitem have not been created... => 
> nothing to press => no way to check a boolean.
>
>
> Regards,
> Flemming
>
>
>
> "Jonathan West"  wrote in message 
> news:e61PtNjCGHA.344@TK2MSFTNGP11.phx.gbl...
>>A sDoug as said, this is annoying but the way Word & Outlook work 
>>together. If you are using Word as the email editor for outlook, then you 
>>cannot assume that the AutoExec macro in a Word Add-in will fire.
>>
>> Once you accept this as expected behavior, then the nature of the 
>> necessary workaround is fairly straightforward. If your add-in has any 
>> user interface items, then any macros triggered by them must first check 
>> to see if AutoExec has been run (you can have it set a public Boolean 
>> variable when AutoExec has finished), and run it immediately if it has 
>> not been run.
>>
>>
>> -- 
>> Regards
>> Jonathan West - Word MVP
>> www.intelligentdocuments.co.uk
>> Please reply to the newsgroup
date: Tue, 27 Dec 2005 09:20:55 -0500   author:   Ken Slovak - [MVP - Outlook]

Re: Outlook blocks Word add-in :-(   
Hi Ken

I can not be sure that the user will write a mail before opening Word, but I 
can use the (Window.EnvelopeVisible = True) to ensure that my menu do not 
work if it's a WordMail item.

Thanks
Flemming


"Ken Slovak - [MVP - Outlook]"  wrote in message 
news:%23rBzEDvCGHA.3064@TK2MSFTNGP10.phx.gbl...
> If it's a WordMail item (Window.EnvelopeVisible = True) then you would get 
> an Outlook NewInspector event from the Inspectors collection each time a 
> new email was opened. Using that event you can check for 
> Inspector.IsWordMail = True to verify the item is using WordMail. Then you 
> can add your button to whatever CustomizationContext you choose.
>
> -- 
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
date: Tue, 27 Dec 2005 20:09:28 +0100   author:   Flemming Dahl

Re: Outlook blocks Word add-in :-(   
Hi Jonathan

Thanks A LOT - I belive this solution will work-a-round the Outlook issue of 
MS Office (sorry Ken)

Thanks
Flemming


"Jonathan West"  wrote in message 
news:O5qeWBvCGHA.3820@TK2MSFTNGP12.phx.gbl...
>
> "Flemming Dahl"  wrote in message 
> news:Obg0m8lCGHA.3984@TK2MSFTNGP14.phx.gbl...
>> Hi Jonathan
>>
>> Thanks for your participation on this issue - and I see your point - 
>> but...
>>
>> AutoExec fires a macro that adds a new menuitem next right next to the 
>> "Help" menu item in Word.
>>
>> When AutoExec have not been fired the menuitem have not been created... 
>> => nothing to press => no way to check a boolean.
>
>
> Oh, I've had a similar problem - a dynamic menu that needed to be built on 
> loading the add-in. There's a workaround for that. Place an ordinary 
> commandbarbutton on the menu. Set its ActionControl property to a macro 
> that replaces the button with the menu you want and then performs the 
> Execute method on the menu to drop it down. The user will have no idea 
> that what he has just clicked was originally a button that has disappeared 
> and turned into a menu.
>
>
> -- 
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
>
date: Tue, 27 Dec 2005 20:13:52 +0100   author:   Flemming Dahl

Re: Outlook blocks Word add-in :-(   
Jonathan West wrote:
> A sDoug as said, this is annoying but the way Word & Outlook work together. 
> If you are using Word as the email editor for outlook, then you cannot 
> assume that the AutoExec macro in a Word Add-in will fire.
> 
> Once you accept this as expected behavior, then the nature of the necessary 
> workaround is fairly straightforward. If your add-in has any user interface 
> items, then any macros triggered by them must first check to see if AutoExec 
> has been run (you can have it set a public Boolean variable when AutoExec 
> has finished), and run it immediately if it has not been run.
> 
> 
Are you still having issues, I can show you my code which was recommend 
by Ken that will remove the commandvar in outlook but re-add it in Word.
Rog
date: Wed, 28 Dec 2005 12:44:44 -0500   author:   Jim

Re: Outlook blocks Word add-in :-(   
Thanks - Ken have given me links to his code.


"Jim"  wrote in message news:43B2CF0C.7060305@yahoo.com...
> Jonathan West wrote:
>> A sDoug as said, this is annoying but the way Word & Outlook work 
>> together. If you are using Word as the email editor for outlook, then you 
>> cannot assume that the AutoExec macro in a Word Add-in will fire.
>>
>> Once you accept this as expected behavior, then the nature of the 
>> necessary workaround is fairly straightforward. If your add-in has any 
>> user interface items, then any macros triggered by them must first check 
>> to see if AutoExec has been run (you can have it set a public Boolean 
>> variable when AutoExec has finished), and run it immediately if it has 
>> not been run.
>>
>>
> Are you still having issues, I can show you my code which was recommend by 
> Ken that will remove the commandvar in outlook but re-add it in Word.
> Rog
date: Thu, 29 Dec 2005 09:56:34 +0100   author:   Flemming Dahl

Re: Outlook blocks Word add-in :-(   
"Jim"  wrote in message news:43B2CF0C.7060305@yahoo.com...
> Jonathan West wrote:
>> A sDoug as said, this is annoying but the way Word & Outlook work 
>> together. If you are using Word as the email editor for outlook, then you 
>> cannot assume that the AutoExec macro in a Word Add-in will fire.
>>
>> Once you accept this as expected behavior, then the nature of the 
>> necessary workaround is fairly straightforward. If your add-in has any 
>> user interface items, then any macros triggered by them must first check 
>> to see if AutoExec has been run (you can have it set a public Boolean 
>> variable when AutoExec has finished), and run it immediately if it has 
>> not been run.
>>
>>
> Are you still having issues, I can show you my code which was recommend by 
> Ken that will remove the commandvar in outlook but re-add it in Word.
> Rog

I have a workaround that works for me, but I'm always interested in learning 
of new or alternative approaches that might work even better. By all means 
post the code!


-- 
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
date: Wed, 28 Dec 2005 21:29:44 -0000   author:   Jonathan West

Re: Outlook blocks Word add-in :-(   
Hi Jonathan

What am I doing wrong here...

When I want to delete CommandBarButton my code fails like this:
    Run-time error '-214746729(80004005)':
    Method 'Delete' of object '_CommandBartButton' failed

It seems like the CommandBarButton is active and can't be deleted...

How do you make it work?

Like this???
cbbJWest.Visible = False
ThisDocument.Saved = True

or how???


This is my code:

Private mcbMenu As CommandBar
Private Const msMY_MENU_NAME As String = "&SuperItWorks"

Public Sub JWestMenuItem()
    Dim cbbJWest As CommandBarButton

    Set mcbMenu = CommandBars.ActiveMenuBar
    Set cbbJWest= mcbMenu.Controls(Replace(msMY_MENU_NAME, "&", ""))
    'mcbMenu.Controls(mcbMenu.Controls(cbbJWest.Caption).Index - 1).SetFocus
    cbbJWest.Delete

    AutoExec

    ' CleanUp
    Set cbbJWest= Nothing
    Set mcbMenu = Nothing
End Sub
date: Thu, 29 Dec 2005 22:12:26 +0100   author:   Flemming Dahl

Re: Outlook blocks Word add-in :-(   
At least with Outlook using WordMail, some properties and methods of a 
button object aren't usable even though the button works and returns some 
properties and fires the Click event.

What has worked for me in those cases (.Delete, .PasteFace, etc.) is to 
reinstantiate the button using FindControl as a new, locally declared button 
object within my cleanup procedure and calling .Delete on that locally 
declared button object.

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Flemming Dahl"  wrote in message 
news:O1ZNTyLDGHA.344@TK2MSFTNGP11.phx.gbl...
> Hi Jonathan
>
> What am I doing wrong here...
>
> When I want to delete CommandBarButton my code fails like this:
>    Run-time error '-214746729(80004005)':
>    Method 'Delete' of object '_CommandBartButton' failed
>
> It seems like the CommandBarButton is active and can't be deleted...
>
> How do you make it work?
>
> Like this???
> cbbJWest.Visible = False
> ThisDocument.Saved = True
>
> or how???
>
>
> This is my code:
>
> Private mcbMenu As CommandBar
> Private Const msMY_MENU_NAME As String = "&SuperItWorks"
>
> Public Sub JWestMenuItem()
>    Dim cbbJWest As CommandBarButton
>
>    Set mcbMenu = CommandBars.ActiveMenuBar
>    Set cbbJWest= mcbMenu.Controls(Replace(msMY_MENU_NAME, "&", ""))
>    'mcbMenu.Controls(mcbMenu.Controls(cbbJWest.Caption).Index - 
> 1).SetFocus
>    cbbJWest.Delete
>
>    AutoExec
>
>    ' CleanUp
>    Set cbbJWest= Nothing
>    Set mcbMenu = Nothing
> End Sub
>
date: Fri, 30 Dec 2005 09:33:35 -0500   author:   Ken Slovak - [MVP - Outlook]

Re: Outlook blocks Word add-in :-(   
Hi Ken

I have made lots of add-ins to both Word and Excel - never to Outlook, since 
my company have been using Lotus Notes until now.

If I can solve it within Word I would prefer so - there is also the 
installation on 6000 pc world wide to take in consideration before changing 
anything that's working.

So my decision for now is - make it within Word.

I have added the following code into my AutoExec

    Dim cbbTempButton As CommandBarButton

    Set mcbMenu = CommandBars.ActiveMenuBar
    Set cbbTempButton = mcbMenu.Controls(Replace(msMY_MENU_NAME, "&", ""))
    With cbbTempButton
        .Visible = False
        .Caption = "SO_Hidden"
    End With
    ThisDocument.Saved = True

I have made another sub that is called by my "temp" button, and that sub 
calles the AutoExec

This have only one disadvantage - first time the user opens Word he/she have 
to press the menuitem twice which could be 6000 clicks world wide. If 
Outlook stays open the rest of the day, then Word will also be open... 
giving no more extra clicks - if not there could be more extra clicks.
This part I don't like.

Cheers,
Flemming
date: Sat, 31 Dec 2005 00:21:50 +0100   author:   Flemming Dahl

Re: Outlook blocks Word add-in :-(   
Hi Flemming,

Don't bother to delete it, just set its Visible property to False.

-- 
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

"Flemming Dahl"  wrote in message 
news:O1ZNTyLDGHA.344@TK2MSFTNGP11.phx.gbl...
> Hi Jonathan
>
> What am I doing wrong here...
>
> When I want to delete CommandBarButton my code fails like this:
>    Run-time error '-214746729(80004005)':
>    Method 'Delete' of object '_CommandBartButton' failed
>
> It seems like the CommandBarButton is active and can't be deleted...
>
> How do you make it work?
>
> Like this???
> cbbJWest.Visible = False
> ThisDocument.Saved = True
>
> or how???
>
>
> This is my code:
>
> Private mcbMenu As CommandBar
> Private Const msMY_MENU_NAME As String = "&SuperItWorks"
>
> Public Sub JWestMenuItem()
>    Dim cbbJWest As CommandBarButton
>
>    Set mcbMenu = CommandBars.ActiveMenuBar
>    Set cbbJWest= mcbMenu.Controls(Replace(msMY_MENU_NAME, "&", ""))
>    'mcbMenu.Controls(mcbMenu.Controls(cbbJWest.Caption).Index - 
> 1).SetFocus
>    cbbJWest.Delete
>
>    AutoExec
>
>    ' CleanUp
>    Set cbbJWest= Nothing
>    Set mcbMenu = Nothing
> End Sub
>
date: Sat, 31 Dec 2005 22:07:28 -0000   author:   Jonathan West

Re: Outlook blocks Word add-in :-(   
That's the right answer Jonathan... cause the CommandBarButton can not be 
deleted as I see it.

Thanks for your help - I got a good solution

Happy new year
Flemming - MVP wannabe
date: Sun, 1 Jan 2006 17:21:55 +0100   author:   Flemming Dahl

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us