1. Runtime error 5101: This bookmark does not exist
I have created a merge template with a number of bookmarks in it. However, on merging, the bookmarks disappear. When I go to the bookmark list, none of the bookmarks are listed. Without the bookmarks, a number of macros in the template don't work. What am I doing wrong. Thanks in advance.
2. Please help me why this script is not doing correctly
3. Error 5101 Bookmark Does Not Exist - Word VB Template - Help!!
Hello, [please let me know if this is wrong group]
I have searched for the problem that I am having and I have found
similar references, but the fixes are correcting the minor issue that I
am having.
Problem: Getting Error 5101 after hitting "OK" on user input form.
Form Description: It's a basic fax UserForm (Name, Pages, Destination,
Fax No, Company, etc) that passes the characters from the UserForm onto
designated positions in the Word document.
In my first creation of this template, everything works fine after
filling out the form. The text and #'s are passed onto the document
perfectly. However, I found that I started getting Error 5101 when I
copied the code from my original project/templated for the creation of
my second project/template which is almost identical but with a differnt
caption for the UserForm . I am also noticing that the UserForm for the
second document (ProjectTemplate as it refers in VB pane) is referencing
the UserForm from my orignial template. I can tell this b/c each
UserForm has a different caption.
Let me know if you have any ideas or suggestions: (Below is pasted code)
Private Sub PB_Cancel_Click()
On Error GoTo PB_Cancel_Click_Error
Application.ScreenUpdating = False
Selection.GoTo What:=wdGoToBookmark, Name:="DocumentStart"
Application.ScreenUpdating = True
Unload Frm_Dialog
Exit Sub
PB_Cancel_Click_Error:
MsgBox "Error Number " & Err.Number & Chr$(13) & Chr$(10) &
Err.Description, vbOKOnly + vbCritical,
ActiveDocument.BuiltInDocumentProperties("Company") & " " &
ActiveDocument.BuiltInDocumentProperties("Title")
Application.ScreenUpdating = True
Unload Frm_Dialog
End Sub
Private Sub PB_OK_Click()
On Error GoTo PB_OK_Click_Error
Application.ScreenUpdating = False
'Insert To Field.
Selection.GoTo What:=wdGoToBookmark, Name:="DocumentStart"
Selection.InsertBefore Text:=TB_To.Text
'Insert Destination.
Selection.GoTo What:=wdGoToBookmark, Name:="Destination"
Selection.InsertBefore Text:=TB_Destination.Text
'Insert Company.
Selection.GoTo What:=wdGoToBookmark, Name:="Company"
Selection.InsertBefore Text:=TB_Company.Text
'Insert Pages.
Selection.GoTo What:=wdGoToBookmark, Name:="Pages"
Selection.InsertBefore Text:=TB_Pages.Text
'Insert From Field.
Selection.GoTo What:=wdGoToBookmark, Name:="From"
Selection.InsertBefore Text:=TB_From.Text
'Insert Sender Field.
Selection.GoTo What:=wdGoToBookmark, Name:="Sender"
Selection.InsertBefore Text:=TB_Sender.Text
'Insert Date.
Selection.GoTo What:=wdGoToBookmark, Name:="Date"
Selection.InsertBefore Text:=TB_Date.Text
'Insert Subject.
Selection.GoTo What:=wdGoToBookmark, Name:="Subject"
Selection.InsertBefore Text:=TB_Subject.Text
'*Position insertion point for user.
Selection.GoTo What:=wdGoToBookmark, Name:="DocumentEnd"
Application.ScreenUpdating = True
Unload Frm_Dialog
Exit Sub
PB_OK_Click_Error:
MsgBox "Error Number " & Err.Number & Chr$(13) & Chr$(10) &
Err.Description, vbOKOnly + vbCritical,
ActiveDocument.BuiltInDocumentProperties("Company") & " " &
ActiveDocument.BuiltInDocumentProperties("Title")
Application.ScreenUpdating = True
Unload Frm_Dialog
End Sub
Private Sub UserForm_Activate()
Frm_Dialog.Caption =
ActiveDocument.BuiltInDocumentProperties("Company") & " - " &
ActiveDocument.BuiltInDocumentProperties("Title")
TB_From = Application.UserName
TB_Date = Format(Date, "MMMM dd, yyyy")
End Sub
4. Please help i need to get homework done - Word Document management
5. Help With Time Formats When Doing A Mail Merge PLEASE
Anyone who can help me I would appreciate it! If I have an excel file or access database file that I am using as a data source when doing a mail merge, how come the time format changes in them? Example: I have a column of appointment times in the short time format (5:00 PM) for example. It appears this way in both access and excel. But when I merge that field into a documnet using Word mail merge, the field ends up displaying as 5:00:00 PM - the "seconds" indicator gets added in. Does anyone know how to fix this??? Thank you.
6. I think Im doing it all wrong - Please Help - VB.Net
7. Strange Problem doing DOS Dir Command in VBA Help Please
Hi Everyone.
This problem is driving me crazy.
Im using Access2003.
Basically what I wish to do is create a new record for each jpg bmp or gif
file in the current directory.
I need to just save the path and filename of each file in a table in its own
record
I am trying to do a DOS command to do a DIR of jpg, bmp and gif files, and
save the output to a file C:\Filelist.txt
using the following line.
Shell (Environ$("COMSPEC") & " /c Dir *.jpg *.bmp *.gif /S /B >
C:\Filelist.txt")
I then try to read that file into the Imagepath field with VBA doing the
following:
Dim Q as string
Open "C:\Filelist.txt" For Input As #1
While Not EOF(1)
DoCmd.GoToRecord , , acNewRec
Line Input #1, Q
Imagepath = Q
Wend
Close#1
Works OK first time used, creates a set of new records, one for each jpg bmp
and gif file in the directory. Bewdy.
But on second and subsequent uses (and a change of the current directory) it
creates a duplicate of the previously created set of records instead of the
contents of C:\Filelist.txt (ie Pass1 creates records OK, Pass2 creates same
records as Pass1, Pass3 creates same records as pass2 etc)
I checked C:\Filelist.txt and it has been created successfully each time
Yet VBA reads its contents incorrectly. Seems to ignore the fact that
C:\Filelist.txt has been overwritten.Always seems to
be one pass behind.
I have even tried using a macro to import C:\Filelist.txt as a table and do
an append query but same problem.
The behaviour of C:\Filelist.txt is odd.
Any help would be extremely appreciated.
Thank you.
Joe.
8. HELP!! Christmas labels done in table not printing - MS Word