Results 1 to 27 of 27

Thread: [RESOLVED] Avoid Mutexing with my Instance of Word

  1. #1

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Resolved [RESOLVED] Avoid Mutexing with my Instance of Word

    How can I avoid mutexing of word with my instance. It should not open the documents opened by user (by dbl-clicking on icon) in my instance of Word.
    This is because I open documents in my instance, do some manupulation and finally close it without saving any files. So chances of user losing his file is high.

    Pradeep
    Last edited by Pradeep1210; Sep 9th, 2005 at 10:53 AM.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  2. #2
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    863

    Re: Avoid Mutexing with my Instance of Word

    keep your instance hidden.
    the user won't see it and can't manipulate it.
    why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
    for every question you ask provide an answer on another thread.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Avoid Mutexing with my Instance of Word

    That will not work since when you create your word object and set it to false for visibility and either shell a doc file or doubleclick a doc file it will open and show the app object. Then if you click on the Windows menu it will show both documents. The use can still switch to your programmed one and manipulate it etc.
    VB Code:
    1. Option Explicit
    2.  
    3. Private moApp As Word.Application
    4.  
    5. Private Sub Command1_Click()
    6.     Set moApp = New Word.Application
    7.     moApp.Visible = False
    8.     moApp.Documents.Add
    9.     moApp.Documents(1).Select
    10.     moApp.Selection.TypeText "Test"
    11. End Sub
    12.  
    13. Private Sub Command2_Click()
    14.     'Or dont shell and just doubleclick on a doc file
    15.     Shell "D:\Program Files\Microsoft Office\OFFICE11\Winword.exe D:\Test.doc", vbMaximizedFocus
    16. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Avoid Mutexing with my Instance of Word

    How do we avoid this?


    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Avoid Mutexing with my Instance of Word

    You can use the "/w" commandline switch to create a new separate instance of Word. If the user double clicks a desktop shortcut to Word or clicks a menu item for Word, it will still do the same.
    VB Code:
    1. Option Explicit
    2.  
    3. Private moApp As Word.Application
    4.  
    5. Private Sub Command1_Click()
    6.     Set moApp = New Word.Application
    7.     moApp.Visible = False
    8.     moApp.Documents.Add
    9.     moApp.Documents(1).Select
    10.     moApp.Selection.TypeText "Test"
    11. End Sub
    12.  
    13. Private Sub Command2_Click()
    14.     'shell and create a new separate instance of Word.
    15.     'The Windows menu will not contain any other documents, etc.
    16.     Shell "D:\Program Files\Microsoft Office\OFFICE11\Winword.exe [b]/w[/b] D:\Test.doc", vbMaximizedFocus
    17. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Avoid Mutexing with my Instance of Word

    But then it will not be a Word.Application object. So how will I reference this instance for the documents I want to open and manupulate from my code?

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Avoid Mutexing with my Instance of Word

    You can create a separate app object variable/
    VB Code:
    1. Option Explicit
    2.  
    3. Private moApp1 As Word.Application
    4. Private moApp2 As Word.Application
    5.  
    6. Private Sub Command1_Click()
    7.     Set moApp1 = New Word.Application
    8.     moApp1.Visible = True
    9.     moApp1.Documents.Add
    10.     moApp1.Documents(1).Select
    11.     moApp1.Selection.TypeText "Command1"
    12. End Sub
    13.  
    14. Private Sub Command2_Click()
    15.     'shell and create a new separate instance of Word.
    16.     'The Windows menu will not contain any other documents, etc.
    17.     Shell "D:\Program Files\Microsoft Office\OFFICE11\Winword.exe /w D:\Test.doc", vbMaximizedFocus
    18. End Sub
    19.  
    20. Private Sub Command3_Click()
    21.     Set moApp2 = New Word.Application
    22.     moApp2.Visible = True
    23.     moApp2.Documents.Add
    24.     moApp2.Documents(1).Select
    25.     moApp2.Selection.TypeText "Command3"
    26. End Sub
    This will create 3 separate Wod instances and all three will not have "Window" menu access to each other.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Avoid Mutexing with my Instance of Word

    So when the user double clicks on any .doc file to open it, will it will open in a fourth instance and When I close these 3 instances, that document won't be closed?

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Avoid Mutexing with my Instance of Word

    If a user doubleclicks a doc file or opens a new instance of Word from the start menu it will open in the first instance of Word, thus sharing the Window menu with the programmitacally opened docs.

    You would have to add the "/w" switch to the standard Word menu item to prevent it.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Avoid Mutexing with my Instance of Word

    I got the point of starting it with /w switch. But the problem is how to get a reference to the Word instance I started with /w switch to set to my object variable so that I can use it in my program?

    Some kind of:
    VB Code:
    1. Set moApp2 = Shell ("D:\Program Files\Microsoft Office\OFFICE11\Winword.exe /w D:\Test.doc", vbMaximizedFocus)
    2. End Sub

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Avoid Mutexing with my Instance of Word

    The programmed instance is fine as well as the swith but it only depends on if the user manually opens another instance of Word after that. If they do, it will attach to what ever instance is open already.
    VB Code:
    1. Option Explicit
    2.  
    3. Private moApp3 As Word.Application
    4.  
    5. Private Sub Command4_Click()
    6.     Shell "D:\Program Files\Microsoft Office\OFFICE11\Winword.exe /w D:\Test.doc", vbMaximizedFocus
    7.     Dim i As Integer
    8.     Dim bFound As Boolean
    9.     i = 1
    10.     Do
    11.         Set moApp3 = GetObject(, "Word.Application")
    12.         If moApp3.Documents(i).Name = "Test.doc" Then
    13.             bFound = True
    14.             Exit Do
    15.         End If
    16.         i = i + 1
    17.     Loop
    18.     If bFound = True Then
    19.         moApp3.Documents(i).Select
    20.     Else
    21.         Set moApp3 = Nothing
    22.         MsgBox "Word Doc not found!"
    23.     End If
    24. End Sub
    This will get the shelled instance but again, if the user opens another instance of Word, it will share the app object.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Avoid Mutexing with my Instance of Word

    Is there no method to disable mutexing altogether (even if the changes are systemwide)?

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  13. #13
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Avoid Mutexing with my Instance of Word

    Not from within Word. I just searched. You will have to go to File Types, and modify the DOC filetype. Just add the "/w" switch to the OPEN property.

  14. #14
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Avoid Mutexing with my Instance of Word

    That is what I have pointed out earlier.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  15. #15
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Avoid Mutexing with my Instance of Word

    Quote Originally Posted by robdog888
    You would have to add the "/w" switch to the standard Word menu item to prevent it.
    That one? I didn't even understand it. I went looking in Word for an option to open in the same window, but didn't find one, so I posted.

  16. #16
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Avoid Mutexing with my Instance of Word

    Right, it doesnt have one. It would require you to add the switch to the start menu, quick launch (if added), and desktop shortcut.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  17. #17
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Avoid Mutexing with my Instance of Word

    Still wouldn't work to double-click on a .DOC file, without changing the filetype

  18. #18
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Avoid Mutexing with my Instance of Word

    Yes, there too. Anyplace the user can start a Word instance you would have to add it.

    Edit: Moved to Office Development
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  19. #19

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Avoid Mutexing with my Instance of Word

    Thanks a lot both of you. I got the point - just conquer all ways the user can open a document and use the /w switch there.

    In file association with .DOC files, it is :
    "C:\Program Files\Microsoft Office\Office10\WINWORD.EXE" /n /dde

    Should I change it to:
    "C:\Program Files\Microsoft Office\Office10\WINWORD.EXE" /w


    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  20. #20
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Avoid Mutexing with my Instance of Word

    No, read this:
    http://support.microsoft.com/default...b;en-us;210565

    Here are the command switches, but may be for Word 2003:
    /safe
    Start Word in Office Safe Mode.
    /ttemplatename
    Start Word with a new document based on a template other than the Normal template (Normal template: A global template that you can use for any type of document. You can modify this template to change the default document formatting or content.). Example: /tMyfax.dot
    Note If the file name has spaces in it, enclose the complete name in quotation marks — for example, /t"Elegant Report.dot"

    Security Because templates can store macro viruses, be careful about opening them or creating files based on new templates. Take the following precautions: run up-to-date antivirus software on your computer, set your macro security level to high, clear the Trust all installed add-ins and templates check box, use digital signatures, and maintain a list of trusted sources.

    /pxslt
    Start Word with a new XML document based on the specified Extensible Stylesheet Language Transformation (XSLT) (XSL Transformation (XSLT): A file that is used to transform XML documents into other types of documents, such as HTML or XML. It is designed for use as part of XSL.). Example: /p:c:\MyTransform.xsl
    /a
    Start Word and prevent add-ins (add-in: A supplemental program that adds custom commands or custom features to Microsoft Office.) and global templates (including the Normal template) from being loaded automatically. The /a switch also locks the setting files.
    /laddinpath
    Start Word and then load a specific Word add-in. Example: /lSales.dll

    Security Use caution when running executable files or code in macros or applications. Executable files or code can be used to carry out actions that might compromise the security of your computer and data.


    /m
    Start Word without running any AutoExec macros (macro: An action or a set of actions you can use to automate tasks. Macros are recorded in the Visual Basic for Applications programming language.).
    /mmacroname
    Start Word and then run a specific macro. The /m switch also prevents Word from running any AutoExec macros. Example: /mSalelead
    Security Because macros can contain viruses, be careful about running them. Take the following precautions: run up-to-date antivirus software on your computer; set your macro security level to high; clear the Trust all installed add-ins and templates check box; use digital signatures; maintain a list of trusted publishers.

    /n
    Start a new instance of Word with no document open. Documents opened in each instance of Word will not appear as choices in the Window menu of other instances.
    /w
    Start a new instance of Word with a blank document. Documents opened in each instance of Word will not appear as choices in the Window menu of the other instances.
    Last edited by dglienna; Sep 11th, 2005 at 03:29 AM.

  21. #21

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Avoid Mutexing with my Instance of Word

    From command line or shortcut it's OK. But to disable mutexing alltogether on my system
    should I edit my file associations to:
    "C:\Program Files\Microsoft Office\Office10\WINWORD.EXE" /w

    Usually users just double-click the DOC file to open it.

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  22. #22
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Avoid Mutexing with my Instance of Word

    Yes, thats the link I got the /w from. As long as your not needing to distribute your app then it doesnt matter if you place it all over. It would be a different story if you were though.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  23. #23

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Avoid Mutexing with my Instance of Word

    Thanks a lot. It's resolved for now.

    One last question before finally closing this thread :
    How much do I pay in terms of memory and CPU to avoid mutexing? Does mutexing reduce CPU and memory load to a great extent?

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  24. #24
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Avoid Mutexing with my Instance of Word

    It could depending on th number of instances of Word you create. When you dont mutate, ut costs you about 300~500 Kb for each additional instance, but when you create separate instances it wil cost a whole lot more like 15 Mb each.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  25. #25

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Avoid Mutexing with my Instance of Word

    Got it
    Mutexing : First Instance 15MB, successive instances - 500KB
    Individual : 15MB per instance !!

    So I'll just have to keep in mind to keep the number of open documents as low as possible. right?

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  26. #26

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Avoid Mutexing with my Instance of Word

    Problem resolved

    Thanks a lot RobDog and David
    I wish I could rate the threads here, but the system just prevents it. But please accept my sincere thanks anyway.

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  27. #27
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [RESOLVED] Avoid Mutexing with my Instance of Word

    Thanks for the Thanks

    The "system" is just probably the spread. You need to give out a few more Reps before you can Rep again.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width