Error 5491 Word
Contents |
be down. Please try the request again. Your cache administrator is webmaster. Generated Mon, 10 Oct 2016 04:24:53 GMT by s_ac15 (squid/3.5.20)
i am calling from Access. also it doesnt matter if i remove dim LT and use List instead:CODESub bulletFormat()Selection.HomeKey wdStoryDim doc
Run Time Error 4605 Word 2010
As Word.DocumentSet doc = ActiveDocumentDim LT As ListFor Each LT In ActiveDocument.Lists microsoft visual basic runtime error 4248 ' this line errorsLT.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _ListGalleries(wdBulletGallery).ListTemplates(1), ContinuePreviousList:= _False, ApplyTo:=wdListApplyToSelection, DefaultListBehavior:= _wdWord10ListBehaviorNextEnd Sub timbailey May 18 2012, 03:41 PM Is runtime error 4248 word 2007 Word installed? Is Word open? Is there an active document in Word? Is it the document with the lists you want to act on? Do you have a reference to http://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other/5491-application-defined-or-object-defined-error/c84ecf2d-9cf9-4b8b-8223-dca2fc7fc86c the Word Object library set in your Access project references?If the answer to all these is "yes", put a breakpoint at the line that errors and see if you can get to the ActiveDocument.Lists collection at all. For example, run the code to the breakpoint and then type?ActiveDocuments.List.Count in the immediate window and see what the count is.If there are http://www.utteraccess.com/forum/lofiversion/index.php/t1987274.html lists, replace the For Each loop with "Set LT = doc.Lists(0)" and see if the first list errors out. Change the index (up to Lists.Count -1) and try each list.These things should give you a clue to where the problem occurs.Tim alv May 21 2012, 09:53 AM Update: Got it to work.Ochanged the way it was being called from Access but if failed about half of the time, so i added error handling on the code in word, that was failing. first adding a msgbox, just to warn that the bullets had not been formatted, but after i did this they always were formatted, so i changed the erorr handling to Resume Next. it now works everytime, ran through it about 20 times, with no issues.o here is the final working code:CODESub bulletFormat()On Error GoTo Bullet_ErrorSelection.HomeKey wdStoryDim doc As Word.DocumentSet doc = ActiveDocumentDim LT As ListFor Each LT In doc.ListsLT.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _ListGalleries(wdBulletGallery).ListTemplates(1), ContinuePreviousList:= _False, ApplyTo:=wdListApplyToSelection, DefaultListBehavior:= _wdWord10ListBehaviorNextBullet_Error:Resume NextEnd Sub This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.
i open the word it displays runtime error 5491. What could be wrong? Nice, Nov 19, 2005 #1 Advertisements Jezebel Guest Have a look at the macros http://www.office-forums.com/threads/run-time-5491.1873521/ in the template you added. There's a bug or error in there. "Nice" <> wrote in message news:... >i have added a template in ms word 2003. When i open the word it displays > runtime error https://bytes.com/topic/access/answers/950699-importing-data-word-form-content-control-into-access 5491. What could be wrong? Jezebel, Nov 19, 2005 #2 Advertisements Show Ignored Content Want to reply to this thread or ask your own question? It takes just 2 minutes to sign up (and it's time error free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum. Sign Up Now! Similar Threads Run-time error '4198' Chubby, Aug 7, 2003, in forum: Word VBA Replies: 0 Views: 225 Chubby Aug 7, 2003 run-time error '4608' value out of range grant thomas, Aug 15, 2003, in forum: Word VBA Replies: 0 Views: 742 grant thomas Aug 15, 2003 Run-time error '4198' runtime error 4248 chubby, Aug 17, 2003, in forum: Word VBA Replies: 1 Views: 905 Cindy Meister -WordMVP- Aug 17, 2003 Re: Run-time error '5121': The Document Name or Path Name is not Valid Cindy Meister -WordMVP-, Aug 24, 2003, in forum: Word VBA Replies: 0 Views: 1,243 Cindy Meister -WordMVP- Aug 24, 2003 ExtendSelection code gives run time error 509 in word XP George Wilson, Aug 28, 2003, in forum: Word VBA Replies: 4 Views: 403 George Wilson Aug 29, 2003 run-time error chubby, Sep 8, 2003, in forum: Word VBA Replies: 0 Views: 69 chubby Sep 8, 2003 Run-time error when exiting Word when Macros are active Ray Callaway, Sep 20, 2003, in forum: Word VBA Replies: 1 Views: 80 Astrid Sep 21, 2003 Run time error 9118 Parameter value was out of acceptable range Guy Cohen, Jan 2, 2004, in forum: Word VBA Replies: 11 Views: 548 Guy Cohen Jan 5, 2004 Loading... Your name or email address: Do you already have an account? No, create an account now. Yes, my password is: Forgot your password? Stay logged in Welcome to Office Forums! Welcome to the Microsoft Office Forums where you can ask questions or find answers on anything related to Word, Excel, Outlook, Access or any of the other Office applications. Please join our friendly community
+ Ask a Question Need help? Post your question and get tips & solutions from a community of 418,502 IT Pros & Developers. It's quick & easy. Importing data from Word form content control into Access P: 15 tsnave I am trying to take the user input from a Word form and place it into an Access DB. I have the document and database in the same folder on my C drive. I am getting an error at : rst.Fields("FullName") = doc.FormFields("txtYourName").Result It is not getting the data from the content control. Here is all of the of the code: Expand|Select|Wrap|Line Numbers SubGetWordData() DimappWordAsWord.Application DimdocAsWord.Document DimcnnAsNewADODB.Connection DimrstAsNewADODB.Recordset DimstrDocNameAsString DimblnQuitWordAsBoolean OnErrorGoToErrorHandling strDocName="C:\SampleForm\"&_ InputBox("EnterthenameoftheWorddocumentyouwanttoimport:","Importdocument") SetappWord=GetObject(,"Word.Application") appWord.Visible=True Setdoc=appWord.Documents.Open(strDocName) Setcnn=CurrentProject.Connection rst.Open"FormData",cnn,adOpenKeyset,adLockOptimistic rst.AddNew rst.Fields("FullName")=doc.FormFields("txtYourName").Result rst.Fields("Address")=doc.FormFields("txtYourAddress").Result rst.Fields("Phone")=doc.FormFields("txtYourPhone").Result rst.Fields("Male")=doc.FormFields("txtMale").Result rst.Fields("Female")=doc.FormFields("txtFemale").Result rst.Update rst.Close doc.Close IfblnQuitWordThenappWord.Quit cnn.Close MsgBox"RequestImported" Cleanup: Setrst=Nothing Setdoc=Nothing SetappWord=Nothing ExitSub ErrorHandling: SelectCaseErr Case-2147022986,429 SetappWord=CreateObject("Word.Application") blnQuitWord=True ResumeNext Case5121,5174 MsgBox"YoumustselectavalidWordDocument."_ &"Nodataimported.",vbOKOnly,_ "DocumentNotFound" Case5491 MsgBox"Thedocumentyouselecteddoesnot"_ &"containtherequiredformfields."_ &"Nodataimported.",vbOKOnly,_ "FieldsNotFound" CaseElse MsgBoxErr&":"&Err.Description EndSelect GoToCleanup EndSub Any suggestions would be great. Thanks Jul 29 '13 #1 Post Reply Share this Question 17 Replies Expert Mod 2.5K+ P: 4,993 zmbd We can not do the basic trouble shooting for you; however, if you will do the following, it will help us to help you: As the line containing: Expand|Select|Wrap|Line Numbers rst.Fields("FullName")