Microsoft Word Error 5151
DriverDoc WinSweeper SupersonicPC FileViewPro About Support Contact Errors Troubleshooting › Runtime Errors › Microsoft Corporation › Microsoft Word › Error 5151 How To Fix Microsoft Word Error 5151 Error Number: Error 5151 Error Name:Microsoft Word Error 5151 Error Description: Error 5151: Microsoft Word has encountered a problem and needs to close. We are sorry for the inconvenience. Developer:Microsoft Corporation Software:Microsoft Word Applies to:Windows XP, Vista, 7, 8 Download NowWinThruster 2015 - Scan your PC for computer errors. Compatible with Windows 10, 8, 7, Vista, XP and 2000 Symptoms of Error 5151 "Error 5151" appears and crashes the active program window. Your PC frequently crashes with Error 5151 when running the same program. “Microsoft Word Error 5151” is displayed. Windows runs sluggishly and responds slowly to mouse or keyboard input. Your computer periodically “freezes” for a few seconds at a time. These 5151 error messages can appear during program installation, while a Microsoft Corporation-related software program (eg. Microsoft Word) is running, during Windows startup or shutdown, or even during the installation of the Windows operating system. Keeping track of when and where your 5151 error occurs is a critical piece of information in troubleshooting the problem. Causes of Error 5151 Corrupt download or incomplete installation of Microsoft Word software. Corruption in Windows registry from a recent Microsoft Word-related software change (install or uninstall). Virus or malware infection that has corrupted Windows system files or Microsoft Word-related program files. Another program maliciously or mistakenly deleted Microsoft Word-related files. Runtime Errors such as “Error 5151” can
soon) Ruby (coming soon) Getting Started Code Samples Resources Patterns and Practices App Registration Tool Events Podcasts Training API Sandbox Videos Documentation Office Add-ins Office Add-in Availability Office Add-ins Changelog Microsoft Graph API Office 365 Connectors Office 365 REST APIs SharePoint Add-ins Office UI Fabric Submit to the Office Store All Documentation https://www.yammer.com/ http://feeds.feedburner.com/office/fmNx Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: Export to a word template - Error 5151 Microsoft Office for Developers > Access for Developers Question 0 Sign in to vote Hello I'm trying to export some data to a MS word http://www.solvusoft.com/en/errors/runtime-errors/microsoft-corporation/microsoft-word/5151-microsoft-word-error-5151/ template. however I'm getting the following error when I click on the form to export the data. Please see the code behind the button and the function to do the export. Private Sub LetterButton_Click() Dim TempString As String TempString = Parent![Fullname] & Chr$(13) & Chr$(10) _ & [Add1] & Chr$(13) & Chr$(10) _ & IIf(IsNull([Add2]), "", [Add2] & Chr$(13) & Chr$(10)) _ & IIf(IsNull([Add3]), "", [Add3] & Chr$(13) & Chr$(10)) https://social.msdn.microsoft.com/Forums/office/en-US/142851ad-9250-4e33-8290-cf597611d0f5/export-to-a-word-template-error-5151?forum=accessdev _ & IIf(IsNull([Town]), "", [Town] & Chr$(13) & Chr$(10)) _ & IIf(IsNull([Pcode]), "", [Pcode] & Chr$(13) & Chr$(10)) _ & IIf(IsNull([County]), "", [County] & Chr$(13) & Chr$(10)) _ & IIf(IsNull([Country]), "", [Country]) Call MergeTextToWord(TempString, "AA-letter") End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub MergeTextToWord(OutText As String, templateName As String) On Error GoTo MergeError Dim objWord As Object Dim x As Variant Dim TplPath As String Dim dbs As database Set dbs = CurrentDb TplPath = dbs.Name TplPath = ExstractPath(TplPath) TplPath = TplPath & templateName Set objWord = GetObject(, "Word.Application") With objWord .Visible = True .Documents.Add TplPath .ActiveDocument.Bookmarks("InsertData").Select .selection.Text = OutText End With Set objWord = Nothing AppActivate "Microsoft Word" Const SWP_NOSIZE% = &H1 Const SWP_NOMOVE% = &H2 x = FindWindow(0, "Microsoft Word") SetWindowPos x, 0, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE SendKeys "{DOWN 3}" Exit Sub MergeError: If Err.Number = 429 Then CreateObject ("Word.Application") Resume End If If Err.Number = 5 Then Resume Next MsgBox Err.Number & vbCr & Err.Description Exit Sub End Sub Function ExstractPath(tPath As String) As String Dim PosN As Long Dim invString, buffString As String Dim i As Integer invString = "" For i = 1 To Len(tPath) invString = Mid$(tPath, i, 1) + invString Next ExstractPath = Left$(tPath, Len(tPath) - InStr(invString, "\")) & "\" End Function Sub O
object the following error may be seen: 5151 Word was unable to read this document. It may be http://theether.net/kb/100120 corrupt. Try one or more of the following: * Open https://www.experts-exchange.com/questions/20935795/Run-Time-Error-5151.html and Repair the file. * Open the file with the Text Recovery converter. 5097 Word has encountered a problem. Sample code: Set objWord = New Word.Application objWord.DisplayAlerts = wdAlertsNone Set objDoc = objWord.Documents.Add("c:\file.doc") Resolution When run from a COM object microsoft word Word does not have a user profile loaded. This causes issues with Word, specifically the inability to load Normal.dotm. Word can be seen trying to use the SYSTEM profile: H:MM:SS.SSSSSSS PM WINWORD.EXE 4032 IRP_MJ_CREATE C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\Microsoft\Templates\Normal.dotm NAME NOT FOUND Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: microsoft word error Read, Write, Delete, AllocationSize: n/a DOMAIN\User To resolve errors in Server Side Office Automation with Word ensure the following folder is created: C:\Windows\SysWOW64\config\systemprofile\Desktop If a specific Normal.dotm is required, it can be opened in the code: Set objWord = New Word.Application objWord.DisplayAlerts = wdAlertsNone Set objDoc = objWord.Documents.Add("c:\normal.dotm") Set objDoc = objWord.Documents.Add("c:\file.doc") References Considerations for server-side Automation of Office http://support.microsoft.com/kb/257757 To Configure Office Applications to Run Under the Interactive User Account http://theether.net/download/Microsoft/kb/288366.html How to configure Office applications to run under a specific user account http://theether.net/download/Microsoft/kb/288367.html How to configure Office applications for automation from a COM+/MTS package http://theether.net/download/Microsoft/kb/288368.html Add Method [Word 2007 Developer Reference] http://msdn.microsoft.com/en-us/library/bb237079.aspx Impersonation Level Constants http://msdn.microsoft.com/en-us/library/ms693790.aspx Problem running Windows Service with Excel Object on Windows Server 2008 (64 bit) http://social.technet.microsoft.com/Forums/en-US/office2007deploymentcompatibility/thread/334c9f30-4e27-4904-9e71-abfc65975e23 Excel 2007 automation on top of a Windows Server 2008 x64 http://social.msdn.microsoft.com/Forums/en-US/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91 Products Microsoft Word 2007 Microsoft Windows Server 2008 x64 Microsoft Office 2007 Microsoft Office 2003 Crea
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Run-Time Error 5151 Want to Advertise Here? Solved Run-Time Error 5151 Posted on 2004-03-29 MS Access 1 Verified Solution 3 Comments 4,663 Views Last Modified: 2009-02-24 I receive a Run-Time error 5151 message when I try out a module in Immediate view. When I choose the debugger it yellow highlights the line: Set m_objects=m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE) Can anyone suggest what's going wrong here? Thanks, Andrew 0 Question by:AndrewMcLaughlin Facebook Twitter LinkedIn Google LVL 65 Best Solution byrockiroads by valid I not only meant a valid path but also the document exists Go to Solution 3 Comments LVL 65 Overall: Level 65 MS Access 59 Message Expert Comment by:rockiroads2004-03-29 is the document path valid? i.e. check what it is beforehand msgbox m_strDIR & m_strTEMPLATE 0 LVL 54 Overall: Level 54 MS Access 53 Message Expert Comment by:nico50382004-03-29 Would help when you post the exact message. Some thoughts: 1) Do you have a final "\" in the m_strDIR 2) Does the constructed name already exist ? Nic;o) 0 LVL 65 Overall: Level 65 MS Access 59 Message Accepted Solution by:rockiroads2004-03-29 by valid I not only meant a valid path but also the document exists 0 Write Comment First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone. Comment Submit Your Comment By clicking you are agreeing to Experts Exchange's Terms of Use. Featured Post How to run any project with ease Promoted by Quip, Inc Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans. - Combine task lists, docs, spreadsheets, and chat in one - View and edit from mobile/offline - Cut down on emails Try Quip Free! Suggested Solutions Title # Comments Views Activity Access query that references subform for criteria 12 37 8d Access - Calculate value of a field based on value of another in the same table 6 21 9d Show top