-
Change Image in .DOT file [RESOLVED II]
What would be the best way to have a user be able to switch the image that is in the .dot fille that we use in a mm? The ways that I can think of to do it woud be to:
Link the file to the app.path with a static file name and load it every time. client would rename his filename to ours to change it.
link the file to registry entry, and change the .dot and registry from within the vb program
have client open .dot file and change the actual picture when they want to change it.
Which is the best/easiest way to do it? How hard is it to have the document load a filename programmatically?
Thanks. This just came up.
-
Re: Change Image in .DOT file
David, the easiest way is to have the image linked and not embedded. Then in your vb program you can let
the user browse for an image. Then you can copy it to the app.path dir or a hidden sub dir and rename the file so
it matches the linked path.
VB Code:
'In Words VBA or convert code to VB6
Private Sub Document_Open()
LoadLogo
End Sub
Private Sub LoadLogo()
'Linked picture
Selection.InlineShapes.AddPicture FileName:="C:\Documents and Settings\VB-Guru\My Documents\My Pictures\DOS1.gif", _
LinkToFile:=True, SaveWithDocument:=True
End Sub
:thumb:
-
Re: Change Image in .DOT file
That sounds good. I'll try to implement it tomorrow, and get back to you. I think I want to do this in VB, not VBA, so could you show me the way to address the image from VB?
Thanks.
-
Re: Change Image in .DOT file
Something like this...
VB Code:
Option Explicit
Private Sub Command1_Click()
Dim oApp As Word.Application
Dim oDoc As Word.Document
Set oap = New Word.Application
oApp.Visible = True
Set oDoc = oApp.Documents.Open("C:\MM.dot")
oDoc.Bookmarks.Item("CompanyLogo").Select
Selection.InlineShapes.AddPicture "C:\Documents and Settings\VB-Guru\My Documents\My Pictures\DOS1.gif", True, True
End Sub
-
Re: Change Image in .DOT file
Allright, I made the picture in the .dot a bookmark, but when I run the program, it adds another picture to the page. I want to replace the image.
I called my bookmark "HomePicture". Also, how do you auto-size it so that the size doesn't change on the page? I'd like it to fit in the bookmark.
Do I need some kind of a range?
Thanks.
-
Re: Change Image in .DOT file
Try this.
VB Code:
Option Explicit
Private Sub Command1_Click()
Dim oApp As Word.Application
Dim oDoc As Word.Document
Set oap = New Word.Application
oApp.Visible = True
Set oDoc = oApp.Documents.Open("C:\MM.dot")
oDoc.Bookmarks.Item("CompanyLogo").Select
Selection.InlineShapes.Item(1).Delete
oDoc.Bookmarks.Item("CompanyLogo").Select
Selection.InlineShapes.AddPicture "C:\Documents and Settings\VB-Guru\My Documents\My Pictures\DOS1.gif", True, True
End Sub
-
Re: Change Image in .DOT file
Error on this line
VB Code:
Selection.InlineShapes.Item(1).Delete
Requestd member of collection does not exist.
-
Re: Change Image in .DOT file
Try placing the filename or filename and path in there instead.
Do you have a count > 0?
-
Re: Change Image in .DOT file
VB Code:
Set oDoc = oApp.Documents.Open(RealPath & "Flyer.dot")
oDoc.Bookmarks.Item("HomePicture").Select
Selection.InlineShapes("HomePicture").Delete
oDoc.Bookmarks.Item("HomePicture").Select
Selection.InlineShapes.AddPicture .FileName, True, True
Type mismatch on the .Delete
there is only the one picture/bookmark
-
Re: Change Image in .DOT file
Try using the .Delete on the Selection object only.
VB Code:
Private Sub Command1_Click()
Set oDoc = oApp.Documents.Open(RealPath & "Flyer.dot")
oDoc.Bookmarks.Item("HomePicture").Select
Selection.Delete
oDoc.Bookmarks.Item("HomePicture").Select
Selection.InlineShapes.AddPicture .FileName, True, True
End Sub
-
Re: Change Image in .DOT file
Now, it doesn't delete the old picture, and places the new picture to the right of the old one. Getting closer...
-
Re: Change Image in .DOT file
.Cut should do it. Replace the Selection.Delete line with Selection.Cut.
-
Re: Change Image in .DOT file
It didn't delete it, but the replacement image got smaller.
That's strange!
-
Re: Change Image in .DOT file
It won't delete the image. I just checked. The Bookmark is called HomePicture, and goto selects it. The other image gets pasted to the right of it, and pushes everytihing else down the page.
i have switched to a .doc to simplify saving it for now...
-
Re: Change Image in .DOT file
It's not cutting or deleting the bookmark, but is moving the cursor there, and then adding an image. isn't there a replace of some sort? i can't imagine why it doesn't work?
-
Re: Change Image in .DOT file
I have no idea why these methods aren't working. They work on mine. There is a .Reset method. It basically reset the image from its filename. Why do you need to delete th eimage if your renaming the selected image? Just rename the selected image and do a .Reset to refresh to the new image.
VB Code:
'ActiveDocument.InlineShapes(1).Select
'ActiveDocument.InlineShapes(1).Delete
ActiveDocument.InlineShapes(1).Reset
-
Re: Change Image in .DOT file
I don't know how he got the image in there initially. It is not linked to a file. I will try to use reset, but it may be something about the way it is set up. The image that is there is a sample. We want the client to choose the image that goes out on the mailmerge. Would it help if I linked the file to begin with?
-
Re: Change Image in .DOT file
Nope. Still does the same thing. Should I upload the doc and the image? I don't know what else to do?
It has word art before the picture, and i just ended up replacing the word art using the ActiveDocument coding here.
VB Code:
oDoc.Bookmarks.Item("HomePicture").Select
ActiveDocument.InlineShapes(1).Select
Selection.Cut
ActiveDocument.InlineShapes.AddPicture .FileName, True, True
ActiveDocument.InlineShapes(1).Reset
-
Re: Change Image in .DOT file
Yes, other then deleting the embedded image the .Reset .Cut .Delete are not working for some reason.
Attach the document and I'll check it out.
-
Re: Change Image in .DOT file
All I managed to do was to change the size of the first wordart with the reset.
something is not right. hope you can figure it out.
-
Re: Change Image in .DOT file
Oh, its a wordart object. Different issue then. I will check it out.
-
Re: Change Image in .DOT file
Ok, I got most of it. Its a Shape object and not a InlineImage or WordArt object. This is a pain to position
and format so I will leave that up to you :D This will delete the picture (finally) and add a new picture
shape. Then you need to format it and position it so its the same as the original. I did some of the formatting
and positioning to help get you started.
VB Code:
Private Sub Command1_Click()
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
oDoc.Shapes(1).Delete
oDoc.Shapes.AddPicture FileName:="D:\Development\About1.gif", LinkToFile:=True, SaveWithDocument:=True ', _
'Left:=-999998, Top:=0, Width:=189, Height:=125.25, Anchor:=0
'Positioning:
oDoc.Shapes(1).Select 'True
oDoc.Shapes(1).Left = 0 '-999998
oDoc.Shapes(1).Top = 200
oDoc.Shapes(1).Width = 189
oDoc.Shapes(1).Height = 125.25
'Formatting:
Selection.ShapeRange.WrapFormat.Type = wdWrapSquare
Selection.ShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
Selection.ShapeRange.LockAspectRatio = msoTrue
End Sub
:thumb:
-
Re: Change Image in .DOT file
Thanks. I'll look into it later, and get back to you.
-
Re: Change Image in .DOT file
Seems like it would have been easier to replace the file with the selected file with the same name and then
refresh the link? But anyways, the posted code will get you the results you wanted.
-
Re: Change Image in .DOT file
unless there is an option to deal with different sized images, i think it was all for moot. it really is a shame, but if you are out of ideas, then I guess that's it.
-
Re: Change Image in .DOT file
Guess you missed my demo code???
VB Code:
oDoc.Shapes(1).Width = 189
oDoc.Shapes(1).Height = 125.25
This part resizes the image to what ever you need. I got it to work on mine but I wasnt going
to fiddle with it so it was perfect. Thats why I said I would get you started on the formatting. Its allot of work.
-
Re: Change Image in .DOT file
Oh. I don't know what happened when I tried it with a big image. I assumed it wasn't doing anything to the original image that I pasted. My apologies.
Can I do the same thing to an Picturebox? I had autoresize on, and the box changed sizes off of the form, and when I turned it off, the picture didn't scale.
Do I just give it the same parameters? (is that in Twips?)
Also, I noticed a tool that might work. CentimetersToPoints(6)
Is it referring to twips?
-
Re: Change Image in .DOT file
Its only for converting centimeters to points. From the help file;
Quote:
CentimetersToPoints:
Converts a measurement from centimeters to points (1 cm = 28.35 points). Returns the converted measurement as a Single.
It doesnt specify what points refer to.
-
Re: Change Image in .DOT file
I got it. I was using a Picturbox, and switched to an Imagebox, and things are autosizing correctly. That wraps it up.
-
One more quick one...
On my system, the replace works fine, but on the tester's system, a save-as dialog popped up asking to save the page with the new image
Does odoc.close false save the document, or do I need to explicitly save it with the same filename? Is that odoc.save "filename" ? or do i need some way to automate the replace dialog box?
Why didn't I get the error on my system?
-
Re: Change Image in .DOT file [RESOLVED]
odoc.close false does not save the document. This is what the False specified - do not save changes.
Are your users running the same version of Word as you?
-
Re: Change Image in .DOT file [RESOLVED]
I have xp and he has 2003, but I want to support all versions of word.
I didn't save it on my system, and it updated the image.
How do i call the save statement to update the file?
-
Re: Change Image in .DOT file [RESOLVED]
To save the current document.
Or to save it as something else ...
VB Code:
oDoc.SaveAs FileName:="Text.rtf", FileFormat:=wdFormatRTF
-
Re: Change Image in .DOT file [RESOLVED]
tester has word 2002 on desktop and word 2003 on laptop.
odoc.save is prompting to save. how do we get rid of it, and save?
-
Re: Change Image in .DOT file [RESOLVED]
VB Code:
oDoc.SaveAs FileName:="MyDocument.doc", FileFormat:=wdFormatDocument
-
2 Attachment(s)
Re: Change Image in .DOT file [RESOLVED]
We still seem to have a problem.
Seems to happen on the second run, on the first run through, it works fine. I then select the second image, and get this.
We moved things arond on the page so that there is no more word wrap. The text is now below instead.
-
Re: Change Image in .DOT file [Almost RESOLVED]
Is Word being closed by the user between runs? This is usually the cause of 429. Attach a sample doc.
-
Re: Change Image in .DOT file [Almost RESOLVED]
Dang. Didn't see your post. Yes, it is being closed. Something might be opening another intance, though. When it crashes, I find WinWord in my list of processes.
EDIT: Updated
-
Re: Change Image in .DOT file [Almost RESOLVED]
Multiple instances of WinWord? If so this is part of the problem.
I will look into your doc tonight when I have enough time to get into it. Allot of work right now. :(
-
1 Attachment(s)
Re: Change Image in .DOT file [Almost RESOLVED]
Also, is there a way to create a space before the first entry in the table below the picture. it seems to overwrite the price no matter what I do. i've tried various breaks and nothing worked.
The multiple instance came from the error halting the program while word was still open. Ending the program left the instance. That is the only way that there were two instances.
If you want to see the code, let me know. Not much else has changed.
I'm posting the newer one now.
-
Re: Change Image in .DOT file [Almost RESOLVED]
The overwritting may be coming from the picturebox resizing? The code I posted before to adjust the formatting
of the image had formatting to make the text wrap around the image. You may have to go back to that version.
-
Re: Change Image in .DOT file [Almost RESOLVED]
that's what wer're using, though. i don't know what the problem is.
VB Code:
oDoc.Shapes.AddPicture FileName:=.FileName, LinkToFile:=True, SaveWithDocument:=True ', _
'Left:=-999998, Top:=0, Width:=189, Height:=125.25, Anchor:=0
'Positioning:
oDoc.Shapes(1).Select 'True
oDoc.Shapes(1).Left = 0 '-999998
oDoc.Shapes(1).Top = 200
oDoc.Shapes(1).Width = 189
oDoc.Shapes(1).Height = 125.25
'Formatting:
Selection.ShapeRange.WrapFormat.Type = wdWrapSquare
Selection.ShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
Selection.ShapeRange.LockAspectRatio = True
oDoc.SaveAs FileName:=RealPath & "Flyer.doc", FileFormat:=wdFormatDocument
oDoc.Close
Set oDoc = Nothing
oApp.Quit
Set oApp = Nothing
End With
Unload oCDBForm
Set oCDBForm = Nothing
-
Re: Change Image in .DOT file [Almost RESOLVED]
Oh, I thought you said you changed it to a picturebox or something.
Are you setting the oDoc = to the active document or the index name of it?
VB Code:
Set oDoc = ActiveDocument
'Or
Set oDoc = oApp.Documents("Flyer")
-
Re: Change Image in .DOT file [Almost RESOLVED]
No, i also have the picture in the vb program. the filename of the doc is hardcoded.
Set oDoc = oApp.Documents.Open("***")
with app.path
-
Re: Change Image in .DOT file [Almost RESOLVED]
tough one? i always seem to pick them. my great suggestion.
-
Re: Change Image in .DOT file [Almost RESOLVED]
I thought you were going to upload a test doc?
-
1 Attachment(s)
Re: Change Image in .DOT file [Almost RESOLVED]
I don't know what happened to it. I uploaded a new one this afternoon.
Oh. It was in #38. I removed it just now.
-
Re: Change Image in .DOT file [Almost RESOLVED]
Can you post your vb code? It works ok in the vba but cant test it for multiple runs.
I will look at the vb code tomorrow.
Later.
-
Re: Change Image in .DOT file [Almost RESOLVED]
VB Code:
Dim ff As Integer
Dim ImageLoc As String
Dim X As Long
Dim Y As Long
Dim oCDBForm As New frmCommonDialog
X = ImageFlyer.Left + ImageFlyer.Width
Y = ImageFlyer.Top
oCDBForm.Move X, Y
With oCDBForm.CommonDialog1
.DialogTitle = "Select Picture to use"
.InitDir = RealPath
.Filter = "Picture (*.jpg)|*.jpg|All " & _
"Files (*.*)|*.*"
.FLAGS = _
cdlOFNFileMustExist + _
cdlOFNHideReadOnly + _
cdlOFNLongNames + _
cdlOFNExplorer
.CancelError = False ' Change to trap cancel True
.ShowOpen
If .FileName = "" Then Exit Sub
ImageFlyer.Picture = LoadPicture(.FileName)
ff = FreeFile
Open RealPath & "ImageLocation.txt" For Output As #ff
Print #ff, .FileName
Close #ff
Dim oApp As Word.Application
Dim oDoc As Word.Document
Set oApp = New Word.Application
oApp.Visible = False
Set oDoc = oApp.Documents.Open(RealPath & "Flyer.doc")
oDoc.Shapes(1).Delete
oDoc.Shapes.AddPicture FileName:=.FileName, LinkToFile:=True, SaveWithDocument:=True ', _
'Left:=-999998, Top:=0, Width:=189, Height:=125.25, Anchor:=0
'Positioning:
oDoc.Shapes(1).Select 'True
oDoc.Shapes(1).Left = 0 '-999998
oDoc.Shapes(1).Top = 200
oDoc.Shapes(1).Width = 189
oDoc.Shapes(1).Height = 125.25
'Formatting:
Selection.ShapeRange.WrapFormat.Type = wdWrapSquare
Selection.ShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
Selection.ShapeRange.LockAspectRatio = True
oDoc.SaveAs FileName:=RealPath & "Flyer.doc", FileFormat:=wdFormatDocument
oDoc.Close
Set oDoc = Nothing
oApp.Quit
Set oApp = Nothing
End With
Unload oCDBForm
Set oCDBForm = Nothing
that's it. works fine the first time, but not the next.
hope you can find something. plus if you can help the over-writing problem that would be great!
-
Re: Change Image in .DOT file [Almost RESOLVED]
There is no reason to create the app each time the button is clicked. Let move some of the word code to the
form load. This way we can recycle the object and hopefuly prevent the 429 issue.
VB Code:
Option Explicit
Private oApp As Word.Application
Private Sub Form_Load()
Set oApp = New Word.Application
oApp.Visible = False
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
oApp.Quit False
Set oApp = Nothing
End SUb
Private Sub Command1_Click
Dim ff As Integer
Dim ImageLoc As String
Dim X As Long
Dim Y As Long
Dim oCDBForm As New frmCommonDialog
X = ImageFlyer.Left + ImageFlyer.Width
Y = ImageFlyer.Top
oCDBForm.Move X, Y
With oCDBForm.CommonDialog1
.DialogTitle = "Select Picture to use"
.InitDir = RealPath
.Filter = "Picture (*.jpg)|*.jpg|All " & _
"Files (*.*)|*.*"
.FLAGS = _
cdlOFNFileMustExist + _
cdlOFNHideReadOnly + _
cdlOFNLongNames + _
cdlOFNExplorer
.CancelError = False ' Change to trap cancel True
.ShowOpen
If .FileName = "" Then Exit Sub
ImageFlyer.Picture = LoadPicture(.FileName)
ff = FreeFile
Open RealPath & "ImageLocation.txt" For Output As #ff
Print #ff, .FileName
Close #ff
Dim oDoc As Word.Document
oApp.Visible = False
Set oDoc = oApp.Documents.Open(RealPath & "Flyer.doc")
oDoc.Shapes(1).Delete
oDoc.Shapes.AddPicture FileName:=.FileName, LinkToFile:=True, SaveWithDocument:=True ', _
'Left:=-999998, Top:=0, Width:=189, Height:=125.25, Anchor:=0
'Positioning:
oDoc.Shapes(1).Select 'True
oDoc.Shapes(1).Left = 0 '-999998
oDoc.Shapes(1).Top = 200
oDoc.Shapes(1).Width = 189
oDoc.Shapes(1).Height = 125.25
'Formatting:
Selection.ShapeRange.WrapFormat.Type = wdWrapSquare
Selection.ShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
Selection.ShapeRange.LockAspectRatio = True
oDoc.SaveAs FileName:=RealPath & "Flyer.doc", FileFormat:=wdFormatDocument
oDoc.Close False
Set oDoc = Nothing
End With
Unload oCDBForm
Set oCDBForm = Nothing
End Sub
(Crossing fingers waiting for response of Success) :D
-
1 Attachment(s)
Re: Change Image in .DOT file [Almost RESOLVED]
Allright. It worked for me, but I have to send it on to get the mark of approval.
Take a look at the .pdf that I just made. It is moving the picture, and then writing the Price underneath it. Is there something that we can do to prevent it?
-
Re: Change Image in .DOT file [Almost RESOLVED]
The Selection.ShapeRange.WrapFormat.Type = wdWrapSquare should be handling this for you.
The only thing I can think of is to change the order so it formats the picture and then after that it sizes it.
-
Re: Change Image in .DOT file [Almost RESOLVED]
Worse. I switch things around and now I get error 91 object variable or with block not set
at the WordWrapSquare line.
VB Code:
oDoc.Shapes.AddPicture FileName:=.FileName, LinkToFile:=True, SaveWithDocument:=True ', _
'Left:=-999998, Top:=0, Width:=189, Height:=125.25, Anchor:=0
'Formatting:
Selection.ShapeRange.WrapFormat.Type = wdWrapSquare
Selection.ShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
Selection.ShapeRange.LockAspectRatio = True
'Positioning:
oDoc.Shapes(1).Select 'True
oDoc.Shapes(1).Left = 0 '-999998
oDoc.Shapes(1).Top = 200
oDoc.Shapes(1).Width = 189
oDoc.Shapes(1).Height = 125.25
-
Re: Change Image in .DOT file [Almost RESOLVED]
You need to have a selection object before you can use the selection object.
Add oDoc.Shapes(1).Select 'True before your formatting.
-
Re: Change Image in .DOT file [Almost RESOLVED]
Still same error: oDoc.Shapes(1).Select added
Is it possible that it is using the wrong object? I know that the image is getting resized, but is the range wrong? also, we are referring to both odoc and selection, and i'm not sure of the difference.
I'd like to be able to help, but I can't find any reference to go by.
-
Re: Change Image in .DOT file [Almost RESOLVED]
VB Code:
oDoc.Shapes.AddPicture FileName:=.FileName, LinkToFile:=True, SaveWithDocument:=True ', _
'Left:=-999998, Top:=0, Width:=189, Height:=125.25, Anchor:=0
'Formatting:
oDoc.Shapes(1).Select 'True
Selection.ShapeRange.WrapFormat.Type = wdWrapSquare
Selection.ShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
Selection.ShapeRange.LockAspectRatio = True
'Positioning:
oDoc.Shapes(1).Select 'True
oDoc.Shapes(1).Left = 0 '-999998
oDoc.Shapes(1).Top = 200
oDoc.Shapes(1).Width = 189
oDoc.Shapes(1).Height = 125.25
:confused:
-
Re: Change Image in .DOT file [Almost RESOLVED]
What can I do? Something isn't right, but I don't know what it is?
Do you still have the document? Can you try it?
:: ka ching :: circled around again, wealth distributed.
-
Re: Change Image in .DOT file [Almost RESOLVED]
Oh, so thats what you meant ;) Thanks.
I ran through three iterations with this code and no problems. I attached the
three docs it generated. It must be something in the commented code or
throughout your project. :confused:
VB Code:
Option Explicit
Private oApp As Word.Application
Private Sub Form_Load()
Set oApp = New Word.Application
oApp.Visible = False
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
oApp.Quit False
Set oApp = Nothing
End Sub
Private Sub Command1_Click()
Dim ff As Integer
Dim ImageLoc As String
Dim X As Long
Dim Y As Long
' Dim oCDBForm As New frmCommonDialog
' X = ImageFlyer.Left + ImageFlyer.Width
' Y = ImageFlyer.Top
' oCDBForm.Move X, Y
' With oCDBForm.CommonDialog1
' .DialogTitle = "Select Picture to use"
' .InitDir = RealPath
' .Filter = "Picture (*.jpg)|*.jpg|All Files (*.*)|*.*"
' .Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNLongNames Or cdlOFNExplorer
' .CancelError = False ' Change to trap cancel True
' .ShowOpen
' If .FileName = "" Then Exit Sub
' ImageFlyer.Picture = LoadPicture(.FileName)
' ff = FreeFile
' Open RealPath & "ImageLocation.txt" For Output As #ff
' Print #ff, .FileName
' Close #ff
Dim oDoc As Word.Document
oApp.Visible = False
Set oDoc = oApp.Documents.Open("D:\Development\Flyer.doc")
oDoc.Shapes(1).Delete
oDoc.Shapes.AddPicture "D:\Development\About1.gif", LinkToFile:=True, SaveWithDocument:=True
'Positioning:
oDoc.Shapes(1).Select 'True
oDoc.Shapes(1).Left = 0 '-999998
oDoc.Shapes(1).Top = 200
oDoc.Shapes(1).Width = 189
oDoc.Shapes(1).Height = 125.25
'Formatting:
Selection.ShapeRange.WrapFormat.Type = wdWrapSquare
Selection.ShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
Selection.ShapeRange.LockAspectRatio = True
oDoc.SaveAs "D:\Development\Flyer3.doc", wdFormatDocument
oDoc.Close False
Set oDoc = Nothing
' End With
' Unload oCDBForm
' Set oCDBForm = Nothing
End Sub
Let me know when you DL the attachments so I can take them off.
-
Re: Change Image in .DOT file [Almost RESOLVED]
Thanks. I have downloaded them. That has got to be one for the books.
I am going to look at them now. That fixed things.
As it turned out, it was probably correct, but I was merging with the wrong letter, (the .dot file still, which I changed to replace the picture when I was still adjusting the sizes)
I had to run things again just now to make sure. The document looked fine on its own, but when it merged is when it got messed up. Now I finally think that things are working right.
I switched the size/format back to the way it was this morning.
Thanks again. I hope this is it for this project.
-
Re: Change Image in .DOT file [RESOLVED II]
:thumb: I think this thread is a new record in the VBA forum :D
Its all just a matter of debugging and resolving the unknowns. :thumb: