Feb 24th, 2005, 09:37 PM
#1
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.
Last edited by dglienna; Mar 3rd, 2005 at 10:46 PM .
Feb 24th, 2005, 10:39 PM
#2
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
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 24th, 2005, 11:16 PM
#3
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.
Feb 24th, 2005, 11:46 PM
#4
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
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 25th, 2005, 05:42 PM
#5
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.
Last edited by dglienna; Feb 25th, 2005 at 08:04 PM .
Feb 25th, 2005, 08:04 PM
#6
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
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 25th, 2005, 08:21 PM
#7
Re: Change Image in .DOT file
Error on this line
VB Code:
Selection.InlineShapes.Item(1).Delete
Requestd member of collection does not exist.
Feb 25th, 2005, 08:29 PM
#8
Re: Change Image in .DOT file
Try placing the filename or filename and path in there instead.
Do you have a count > 0?
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 25th, 2005, 08:36 PM
#9
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
Last edited by dglienna; Feb 25th, 2005 at 08:46 PM .
Feb 25th, 2005, 08:49 PM
#10
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
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 25th, 2005, 08:54 PM
#11
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...
Feb 25th, 2005, 08:58 PM
#12
Re: Change Image in .DOT file
.Cut should do it. Replace the Selection.Delete line with Selection.Cut.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 25th, 2005, 09:00 PM
#13
Re: Change Image in .DOT file
It didn't delete it, but the replacement image got smaller.
That's strange!
Feb 25th, 2005, 09:06 PM
#14
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...
Feb 25th, 2005, 09:16 PM
#15
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?
Feb 25th, 2005, 09:24 PM
#16
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
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 25th, 2005, 09:27 PM
#17
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?
Feb 25th, 2005, 09:36 PM
#18
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
Last edited by dglienna; Feb 25th, 2005 at 09:42 PM .
Feb 25th, 2005, 09:43 PM
#19
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 25th, 2005, 09:50 PM
#20
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.
Last edited by dglienna; Feb 25th, 2005 at 09:57 PM .
Feb 25th, 2005, 09:51 PM
#21
Re: Change Image in .DOT file
Oh, its a wordart object. Different issue then. I will check it out.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 25th, 2005, 11:06 PM
#22
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 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
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 25th, 2005, 11:08 PM
#23
Re: Change Image in .DOT file
Thanks. I'll look into it later, and get back to you.
Feb 25th, 2005, 11:26 PM
#24
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 26th, 2005, 01:36 PM
#25
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.
Feb 26th, 2005, 01:42 PM
#26
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 26th, 2005, 08:34 PM
#27
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?
Feb 26th, 2005, 10:56 PM
#28
Re: Change Image in .DOT file
Its only for converting centimeters to points. From the help file;
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 28th, 2005, 11:00 PM
#29
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.
Mar 1st, 2005, 04:15 PM
#30
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?
Mar 1st, 2005, 04:35 PM
#31
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?
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Mar 1st, 2005, 04:59 PM
#32
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?
Mar 1st, 2005, 05:23 PM
#33
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
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Mar 1st, 2005, 09:46 PM
#34
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?
Mar 1st, 2005, 10:52 PM
#35
Re: Change Image in .DOT file [RESOLVED]
VB Code:
oDoc.SaveAs FileName:="MyDocument.doc", FileFormat:=wdFormatDocument
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Mar 1st, 2005, 11:19 PM
#36
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.
Last edited by dglienna; Mar 1st, 2005 at 11:29 PM .
Mar 2nd, 2005, 01:34 PM
#37
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Mar 2nd, 2005, 02:34 PM
#38
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
Last edited by dglienna; Mar 3rd, 2005 at 01:23 AM .
Mar 2nd, 2005, 04:08 PM
#39
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Mar 2nd, 2005, 04:29 PM
#40
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.
Attached Images
Last edited by dglienna; Mar 2nd, 2005 at 04:37 PM .
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width