Office 2013 - Unable to open word template

Hi,
I have windows service written in VC++ and trying to open a word template xxx.dotx located on the server. however, I am geting below error code while opening the same template. I have written a sample application and it is opening the template.
my windows service is 32 bit and I have installed office 2013 64bit and OS win 7 64bit.
<hr=-2147467259>
working code
#import "MSO.DLL" rename_namespace("MSOFFICE") rename("RGB", "ofRGB") rename("DocumentProperties", "ofDocumentProperties")
#import "VBE6EXT.OLB" rename_namespace("MSVBEXT") rename("Application", "ApplicationVBExt") raw_interfaces_only
#import "msword.olb" rename_namespace("MSWORD") rename("DialogBox", "DialogBoxWRD") rename("RGB", "RGBWRD") rename("DocumentProperties", "DocumentPropertiesWRD") rename("ExitWindows", "ExitWindowsWRD") named_guidsvoid CWordTestDlg::OnButton1()
// TODO: Add your control notification handler code here
MSWORD::_ApplicationPtr m_pWordApp;
HRESULT hr = m_pWordApp.CreateInstance("Word.Application");
if(FAILED(hr))
AfxMessageBox("Unable to start MS Word.", hr);
return;
AfxMessageBox("Successfully Created");
m_pWordApp->DisplayAlerts = MSWORD::wdAlertsNone;
// Make sure the application is not visible.
m_pWordApp->Visible = VARIANT_FALSE;
MSWORD::_DocumentPtr m_pWordDoc = NULL;;
MSWORD::DocumentsPtr pDocs = m_pWordApp->Documents;
if(pDocs == NULL)
AfxMessageBox("Unable to retrieve the documents collection from MS Word.", pDocs);
return;
// Open the template.
CComVariant varTemplateName(_T("\\\\xxx.xxx.xxx.xxx\\kx.dotx"));
m_pWordDoc = pDocs->Open(&varTemplateName);
if(m_pWordDoc == NULL)
CString msg;
msg.Format("Unable to open %s.", _T("\\\\xxx.xxx.xxx.xxx\\kx.dotx"));
AfxMessageBox(msg);
return;
AfxMessageBox("Successfully Opened");
m_pWordApp.Detach();
// Reset the MSWord Document ptr.
m_pWordDoc.Detach();
thanks,
Krishna

Hi,
Interop is not supported on a Server or with in a services.
But if you want to this, you have to set up the Environment. I follow this Guideline with my Word and I'm able to start Word on a Server.
1) Goto Control panel -> Administrative Tools -> Component Services
2) Expand Tree by clicking on Component Services -> Computers -> My Computer -> DCOM Config
3) Search CLSId 00020906-0000-0000-C000-000000000046 (which is for Word 97-2003 application)
4) By selecting 00020906-0000-0000-C000-000000000046 this CLSId now right click on Properties
5) In the Propeties area, click on Security TAB
6) Select Customize option from all (Launch and Activations Permissions, Access Pemissions, Configuration Permissions)
7) Take the User of the Services and Allow all permissions for this user
8) Go to Identity TAB in the same properties area, select option as a This user and then add username (the user must be administrator of this machine) and password. Click on Apply, Ok
 Locale Profile: True
9) Refresh Component Services and check your application is working fine or not.
10) set Folder, if not present:
   C:\Windows\SysWOW64\config\systemprofile\Desktop
This article gives some insights.
http://theether.net/download/Microsoft/kb/288367.html
Hope this helps.
Kind Regards
Thomas

Similar Messages

  • Office 2013 can't open word, excel files from the network after upgrade to 8.1

    Hello,
    Recently, I upgraded all PCs from WIN 8 to Win 8.1. After the upgrade I noticed that I can't open any word documents and excel files. Before the upgraded I have no problem opened any files. All PCs have over 500GB free space on hard drive. Other PCs that
    run Win 7 have no problem open them only the one with Win 8.1. This is what I got:
    I right click--> property and there is no unblocked. All files resided on the network server.
    Please help.
    Jimmy

    Hi Jimmy,
    Did you get any error message when you try to open an Excel file/Word document?
    If so, you can post the error message and  event log here.Also ,if you had antivirus software installed, try to disable them to test this issue.
    In addition, what happens if you add the network server location as a trusted location?
    Wind Zhang
    TechNet Community Support

  • Out of the blue, unable to open Word attachment in Mail with double click. Have to Right click, open with, select Microsoft Word. Am running Snow Leopard and Microsoft Office for Mac 08. Cheers

    Out of the blue, am unable to open Word attachments in Mail with the usual double click. (Get a longwinded error message)
    Need to right click, select open with, and select Microsoft Word. Have been using Microsoft Office for Mac 08 for years.
    I have reinstalled the Office software. A couple of tech people have been unable to fix it. Any suggestion?? debsuemy

    Please re-post in the Office for Mac Product Forums .

  • Office 2013 simply refuses to update templates

    Hi All,
    Was wondering if you could help as i'm really getting thin on ideas now.
    I've been working with Azure RMS for a couple of weeks with no problem but all of a sudden I can't get Office 2013 to update the custom templates I've been creating on multiple devices.
    I've created custom templates before that have refreshed in Office perfectly but new ones simply will not download. As far as I'm aware everything is set as it should be  in terms of the template is published and my user account is within the scope
    of users who can use the template.
    I have installed the RMS sharing app on my Win 8.1 machine and when right clicking a file to complete an in place protect the most up to date templates are present but whilst working directly within Word or Excel etc the templates are out of date.
    I've tried all sorts of combinations of deleting the templates folder in: %AppData%\Local\Microsoft\MSIPC\Templates and deleting the LastUpdateTime dword, signing out of office and signing in again but nothing I try seems to help.
    Does anyone have any ideas of what I could try?
    Thanks in advance!

    While this feature (departmental templates) is in Preview, Office applications don't recognize these templates, by default.  From
    https://technet.microsoft.com/en-us/library/dn642472.aspx#BKMK_HowToConfigureCustomTemplates, see step 8 and the behavior you're seeing:
    Not all applications can support departmental templates. To do so, the application must first authenticate with the RMS service before downloading the templates. If the authentication process does not occur, by default, none of the departmental templates
    are downloaded. 
    There is a script that you can run (see the Note) for this to work with Office applications during the Preview period. We were hoping to get the script on the Download Center, but it's currently on the Connect site.  If you have problems accessing it,
    email [email protected] 

  • Unable to open word document in CV02N

    Hi Guru's
    Am unable to open word documents in CV02N & CV03N.
    While i try to open word document which is been already uploaded,Am getting the message as                                                       "26.112 bytes transferred" but document is not getting opened while a temporary files are getting created in C:/.
    I av done complete settings in DC20 & DC30...but stil unable to open word documet.
    Kindly help me to resolve this issue..
    Regards
    Bhanu

    Hi,
    Below are the work station application settings done for word document
    WS application:  DOC
    Description : Win word 6.0
    Archive identification:  *
    File suffix for appl.: doc
    File format : .doc,.docx
    MIME type: application/mswinword
    Start Authorisation is Enabled.
    PC     DOC      1     Winword 6.0     wwiexe32.exe
    PC     DOC      2     Winword 6.0     wwiexe32.exe
    PC     DOC      3     Winword 6.0     wwiexe32.exe
    Regards
    Bhanu

  • HT4993 I am unable to open word attachments from my work email ever since I bought the 5c. The word documents just flutters but will not open

    I am unable to open word documents as attachments from my 5c. I never had the problem with the 4s. Is it something in the settings?

    NiciMac wrote:
    Working on reviewing book chapters for a large NPO and have a big problem trying to open multiple Word files attached to incoming emails. Am using OS 10.5.8 and AOL email account, Word for Mac 2008 with auto-updates. If more than one Word file is attached, I get a message, "filename.doc uses a file type that is blocked from opening in this version." None of the suggested work-arounds to open the file (such as from within Word) will work.
    Since you didn't describe "the suggested work-arounds" I can only guess whether you've tried this, but in that message there should be a paperclip icon on the left at the bottom of the header. If you drag that icon onto your computer's Desktop, you should see the attachment(s) there. Can you open them by double-clicking?

  • Office 2013 Will not open documents in a shared folder but 2007 will.

    Hi,
    Recently we are testing office 2013 and have noticed a problem. When office attempts to open an Excel or Word document that is stored on a shared drive on the file server it will not open it. When you double click on the document, either word or
    Excel, the appropriate Office app opens, but it opens on the start screen, i.e. the one with the templates displayed.
    There are no error messages displayed , and it appears that the office app opens twice, i.e you see the splash screen with the app name on it two times in quick succession, however you cannot find two instances of the app open.
    If you simply copy the document from the shared drive to the users desktop and then double click the file , the appropriate app opens and the file also opens without a problem.
    Also if you go to a client machine with office 2007 loaded on it then the document on the shared drive opens without a problem at all.
    The client machine with office 2013 is a Dell E7440 with windows 7 Pro 64bit.
    Thanks in advance

    I think its working now.
    Here is what I had to do.
    Delete Office from the machine once again, this time using the Microsoft tool to remove all remnants of the office software , then manually check the registry to see all the referenced keys had been removed.
    Reboot.
    Copy all the users data to another location on the same machine.
    Delete the users profile.
    Reboot.
    Reload office using the link Dell sent me.
    Reboot.
    Log in as a domain admin and check that office would open the documents on the file share and it did.
    Reboot.
    Log in as the user who’s profile I had deleted so that the profile was recreated.
    Attempt to open documents on the file share and it was successful.
    Move most of the users data back to the users folder so that his system looked the same as before.
    Reboot.
    Try again to use office applications and open documents from the file share and it continued to function correctly.
    Waited a day for the user to see how it went and it is still working now.
    I have no idea what could have been causing this problem or why doing what I did above fixed it.
    I hope the problem does not return.
    Now we can move on with more testing to see its suitability to our field service engineers, remote connections and connections to our customer systems will be checked next.

  • Office 2013 will not open unless user is a Domain Admin

    In order to get the Office 2013 suite to install from Office 365, I had to make all the users (115 in 4 offices) a domain admin, we then installed the software on everyone's computers and we have migrated our email.  However, I now need
    to remove all the users from being a domain admin, but when I do none of Office programs will open, no error message, just a spinning wheel for 10 seconds and nothing.   I need to remove the users from being a domain admin as they can now see
    network drives that they were previously restricted from.  All computers are Windows 7 Pro.  I have even installed the suite on a brand new computer, installed as admin, login as a domain user and nothing will open.
    Thanks

    What's the default right for the user in your domain, domain user?
    Can we open the Office application when the domain user is in local administrator group?
    Please turn off all of security programs and 3rd-party programs (Windows clean boot) and then launch Office component, such as Word.exe with safe mode. ("Winword.exe /safe") to check if it opens successful in non-domain user rights.
    Don't use Office shortcut to open Office but double click the .exe file under %programfiles%\Microsoft Office to check if the office process appears in Windows Task Manager. 
    In addition, please go to eventvwr to check if there is any errors regarding to permission or Office exist. If so, post it here for further checking. Thanks. 
    Tony Chen
    TechNet Community Support

  • Office 2013 Crashes when Opening Downloaded Files

    Hello,
    I am running Office 2013 on Windows 7; anytime I attempt to open a Word document that has been downloaded from my email, the program crashes.  I see the Word splash screen, then the document opens for about two seconds, then it crashes.  Upon reopening
    Word, I am prompted to repair the program.   After I repair the program and reopen Word again, I am prompted to reactivate the software.  
    If the attachment is saved directly to the computer, then opened from Word internally, the program works fine.  I have already unchecked the boxes in the Trust Center and disabled the COM add-ons.
    Any assistance would be appreciated!

    Hi,
    I’m a little confused about the difference between “open a Word document downloaded from your email” and “attachment is saved directly to the computer”. What is the difference between
    them?
    Do you open the document on OWA or from Outlook client?
    If there is no issue when opening it from OWA, this issue may be related to Outlook client.
    Let's troubleshoot this from running Outlook in Safe Mode, to determine if it is 3rd-party add-ins related. Press Win + R and type “outlook.exe /safe” in the blank box, then press Enter. Then we may try to open the attachment, if there’s no problem in Safe
    Mode, disable the suspicious add-ins to verify which add-ins caused this issue.
    We may also perform a clean boot to determine if background programs are interfering with Word:
    http://support.microsoft.com/kb/929135
    If Word crash still appears on local disk, we can analyze crash file.
    Let’s enable app crash dump collection by copying following words into notepad, saving it as dump.reg and importing it:
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\localdumps\WORD.EXE]
    "DumpFolder"=hex(2):63,00,3a,00,5c,00,63,00,72,00,61,00,73,00,68,00,64,00,75,\
      00,6d,00,70,00,73,00,00,00
    "DumpCount"=dword:00000010
    "DumpType"=dword:00000001
    "CustomDumpFlags"=dword:00000000
    Then, open Word to repro the issue. If crash issue appeared, please find the crash dump file under c:\.
    To further help you, please upload this file into OneDrive and shared the link here.
    Also, you can try to analyze dump by yourself if you would like to:
    How to analyze app crash dump file:
    http://blogs.technet.com/b/askperf/archive/2007/05/29/basic-debugging-of-an-application-crash.aspx

  • Outlook 2013 won't open Word and Excel attachments

    Had a new PC set up with MS Office 2013 programs.  Outlook 2013 Word and Excel attachments do not open.  Program opens, but to a blank screen.  This includes my attachments created on the same computer.  Boxes in "Trust Center"
    are unchecked.  Problem persists.  It is possible to save the attachment, then open Word or Excel and see the saved file, but this is time consuming and annoying.  Outlook 2013 should just open its attachments from the message without a thousand
    extra steps.  Thank you.

    Hi Gish,
    Thank you for your question.
    Did this issue occur in OWA?
    We could open outlook->File->option->Trust Center ->Microsoft Outlook Trust Center->Trust Center Setting->Attachment Handing->Attachment and Document Preview…
    Then we make sure all option have check. And didn’t uncheck “Turn off Attachment Preview”, or rebuild the profile to check if the issue persist.
    If there are any questions regarding this issue, please be free to let me know. 
    Best Regard,
    Jim
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Jim Xu
    TechNet Community Support

  • Office 2013 will not open any applications

    I am having a problem with a number of users complaining that Office 2013 applications will not open. I double click on the icon, or single click on the tile (Windows 8.1) nothing happens. Looking at the task manager the only thing related to the office
    is the Office ClickToRun service is running.
    The only thing I can do to get things working again is to do a full repair from the Programs and Features Control Panel Applet. I have tried the quick repair and numerous other things but nothing else works. I have let it go for many hours thinking it may
    be installing something but still nothing happens.
    Since I know how to fix it, the problem has a work around, however, since I am running a good number of workstations using 2013 this way I am afraid this is going to happen to more users (So far it is three users).
    Please help, there must be a way to fix this instead of repairing every time it happens.

    Hi,
    Do you try to open Office with below methods?
    Go to Office location folder to open Office suits.
    Press Win+R>Enter winword.exe (or other)
    If we can open them, please follow the KB and re-create the software shortcut in Windows 8.1
    http://support.microsoft.com/kb/2820848/en-us
    If we still can't open them, please first let me know the update lists you have installed before this issue.
    Then, restore the system back to the point when the Office app work fine.
    As following, we can install these updates one by one to navigate which update cause this issue.
    Then post back the KB number and full name here.
    I will try to reproduce your issue and plan for further troubleshooting steps.
    Thanks
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

  • After updating Firefox, I am unable to open word attachments from my Outlook email, although the download works when I check emails in Internet Explorer

    Following a Mozilla update, Jave console has been disabled and is incompatible with the new upgrade. I'm not sure if this is affecting my ability to open word documents that are attached to email, but I am unable to do this when I open my emails though Firefox. If I open them in Internet Explorer, the .doc file will open normally. I just prefer to use firefox rather that internet explorer

    I just got off the phone with support. First, he claimed that WAV files are not supported (although the user guide claims it is). Next, he suggested that WAV files that are transfered through BB Desktop will work, but not files that are downloaded from attachments. Finally, he stated that the file must be in the Music folder in order to work. I was able to use AIR Browser to move the file over to the Music folder, but it still won't play. When BB Desktop syncs music files over, does it create a specific subdirectory in the Music folder? Has anyone been able to get a WAV file to play (regardless of how it got on to the PlayBook)?

  • Acrobat ribbon missing on office 2013 (specifically outlook and word)

    I just downloaded acrobat xi on my desktop PC w/ windows 7 professional.
    The acrobat ribbon is missing on outlook and word programs.  I tried the troubleshoot recommended by adobe and it does not work.
    Any suggestions?

    Hi Mardic,
    Compatibility with Office 2013 has been added from Acrobat 11.0.1 on-wards.
    You need to update Acrobat for the pdfmaker to appear in Office applications. The latest version is 11.0.10
    Regards,
    Rave

  • Unable to open Word doc "Submitted" to a cell in form

    Hi,
    I am unable to open a Word doc "Submitted" to a cell in form. When I select the cell and select menu open "Open Doc", I see a IE web page flash quickly before disappearing.
    In contrast I can open a TEXT file - a IE web page would display the contents.
    I am guessing it is IE related - perhaps it is not able to display Word nor Excel docs?
    Has anyone else found a way around this limitation. I even tried opening Excel docs while running webform on the Planning server itself.
    I set IE options to allow everything and to trust the planning website.

    You are right Alp, I don't understand the permissioning of folders and its artifacts (e.g. files). I know Planning and Essbase security well but Workspace's security stumps me!??
    I don't understand what part "Roles" have. I gave a security group "FULL CONTROL" to the folder, and Select "Apply Permission to Children". However, that folder's permission did not get pushed to the artifacts in it.
    I read online HELP but don't understand it.

  • Unable to Open Word Documents Since Mavericks 10.9.5 Update

    Since updating to Mavericks 10.9.5, I can no longer open Word documents that were created/edited between 8-27 and 9-18-14, and that I had opened 9-17 and earlier.  I receive the following message when I attempt to open a document:
    "Word cannot open this document.  The document might be in use, the document might not be a valid Word document,
    or the file name might contain invalid characters (for example, \ /)."
    I have Microsoft Word for Mac 2011, version 14.3.5., and a MacBook Air 1.8GHz, Intel Core i7, mid 2011.  Can you help?

    Anybody else experiencing this? No mention of effects on Quicktime in the 10.9.5 upgrade notes.
    Unable to duplicate your problem in random tests of my library. M4V (H.264/AAC/AC3/Chapter encoded) files continue to play normally in both QT 7 and QT X players. Anything special about your files or anything unusual happen during the system upgrade installation?

Maybe you are looking for