Micro Focus QTP (UFT) Forums
Trying to run MS Word startup file for Add-in - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Trying to run MS Word startup file for Add-in (/Thread-Trying-to-run-MS-Word-startup-file-for-Add-in)



Trying to run MS Word startup file for Add-in - rahul29 - 02-13-2012

I am trying to get a startup file for MS Word (Addin Custom.dotm) be run thru below script. The script is working, but I didn't get the add-in (extra menus) to show in MS Word. Could you tell me if the below script would actually run the extra file?

Code:
Call MacrosVBALoad()

Sub MacrosVBALoad()
Dim ExtraPath  
Set obj_Word = CreateObject("Word.Application")  
'Load New Macros Program'
  On Error Resume Next
ExtraPath= obj_Word.Options.DefaultFilePath(wdStartupPath)
  obj_Word.AddIns.Add ExtraPath+"Addin Custom.dotm", True
obj_Word.visible = True
obj_Word.Documents.Add()
End Sub

There was no error when running above script, and MS Word opened. But i didn't see the extra menus that should show with the Add-ins. Any help to make this work would be appreciated.
I am using Qtp 10, and MS Word 2007.